error accessing dll
Article Writing
2
Posts
2
Posters
0
Views
1
Watching
-
While using 'DLL' created with 'VC++' in VB i am getting an error "Bad DLL calling convention". Is it the problem with declaration of Calling conventions in vc++? How to avoid it?
I don't know VB, but you need to export the function with the calling convention that VB uses. Since the default in VC is __cdecl, I imagine the right convention is __stdcall. For example:
extern "C" __declspec(dllexport) void **__stdcall** MyFunc() {}
(The order of the tokens may be off - I never can remember which one goes where.) --Mike-- http://home.inreach.com/mdunn/ This must be Thursday. I never could get the hang of Thursdays...