
| Last Modification: December 11, 1999 |
Why
do I get "Bad Calling Convention" when trying to call my VC++ dll from
VB?
Visual Basic only supports calling functions in Dlls that are declared with the
__stdcall calling convention. This is different from the default convention in
VC++, __cdecl, which stands for "C' calling convention. The two are
not the same (but that's another topic) and are not interchangeable. The
solution? make sure you declare your dll's functions as __stdcall.