I feel pretty stupid...
-
...but I'll have to ask anyway :) How to I import functions from a dll that don't have name decoration? If I do a
__declspec(dllimport) void __stdcall MyFunc
I get something like__imp__MyFunc@4
, if I do aextern "C" void __stdcall MyFunc
I get C name decoration:_MyFunc@4
and all this results in unresolved external symbols. The Win32 API does it by I can't get it to work... anyone plz?Cheers,
Marc:beer: Click to see my *real* signature :beer:
-
...but I'll have to ask anyway :) How to I import functions from a dll that don't have name decoration? If I do a
__declspec(dllimport) void __stdcall MyFunc
I get something like__imp__MyFunc@4
, if I do aextern "C" void __stdcall MyFunc
I get C name decoration:_MyFunc@4
and all this results in unresolved external symbols. The Win32 API does it by I can't get it to work... anyone plz?Cheers,
Marc:beer: Click to see my *real* signature :beer:
Look up stdcall (or maybe __stdcall). Basically it's PASCAL calling conventions that Win32 uses. Draw your own conclusions re. the history of Windows (though that its linker initially needed a switch to _obey_ case sensitivity rules might be a hint :-) ).
-
...but I'll have to ask anyway :) How to I import functions from a dll that don't have name decoration? If I do a
__declspec(dllimport) void __stdcall MyFunc
I get something like__imp__MyFunc@4
, if I do aextern "C" void __stdcall MyFunc
I get C name decoration:_MyFunc@4
and all this results in unresolved external symbols. The Win32 API does it by I can't get it to work... anyone plz?Cheers,
Marc:beer: Click to see my *real* signature :beer:
Look up these WinAPI functions: LoadLibrary() GetProcaddress() James Drinking In The Sun Forgot Password?
-
Look up these WinAPI functions: LoadLibrary() GetProcaddress() James Drinking In The Sun Forgot Password?
Originally, I intended to link to the DLL statically (at compile time), but it turned out to be slightly more tricky than I thought, so I had to fall back on a wrapper class that links to it at run-time, as you suggest it. :|
Cheers,
Marc:beer: Click to see my *real* signature :beer: