I have a very simple dll that exports a simple function "int Add (int,
int)". I use the function from an executable using LoadLibrary and
GetProcAddress. When calling convention is "cdecl" so far so good but with
"stdcall" GetProcAddress returns 0. When I look at the export list I see the
function exported as _Add@8. Well, how can I dynamically address stdcall
functions from .dll's without knowing those strange (and I think not
reliable to depend on) names? AFAIK, windows API functions generally use
stdcall calling convention and we can address those functions dynamically
(using LoadLibrary+GetProcAddress) using their straight names, what is the
trick?
Thanks in advance.
now you can GetProcAddress on "Add".
Most of Microsofts Dlls were built with .def files (even MFC since it
exports no names at all!)
"K�r�at" <kursat...@gmail.com> wrote in message
news:%231IeTEp...@TK2MSFTNGP05.phx.gbl...
You can call GetProcAddress on _Add@8
"K�r�at" <kursat...@gmail.com> wrote in message news:%231IeTEp...@TK2MSFTNGP05.phx.gbl...
Actually, that is more hassle than necessary. You can simply use this:
EXPORTS
Add
Even without the "=_Add@8" the linker will do The Right Thing(tm).
Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
"Scot T Brennecke" <Sc...@MVPs.spamhater.org> wrote in message
news:eJxp2Ftz...@TK2MSFTNGP04.phx.gbl...
"Alexander Grigoriev" <al...@earthlink.net> wrote in message
news:%23YQiSnx...@TK2MSFTNGP06.phx.gbl...