HI all,
I have a VB.exe what calls a c dll that calls a fortran dll.
It calculate 100% the values, but gives 49 -Bad DLL calling convention.
Any idea's
Thanks
Christo
Printable View
HI all,
I have a VB.exe what calls a c dll that calls a fortran dll.
It calculate 100% the values, but gives 49 -Bad DLL calling convention.
Any idea's
Thanks
Christo
I am assuming that you have declared the API call correctly, so I won't try to explain that.
The problem is likely to be in the C++ dll export.
If you have a .H file for the C++ dll then check the following:
if the function youare calling is declared as: '__declspec(dllexport) FunctionName' then you will get this error at runtime in the VB IDE, and not after the application is compiled!
To overcome, in the C++ dll, modify the function declaration to: '_stdcall FunctionName'
This problem is because the VB compiler sorts out the datatpe conversion correctly, although the IDE cannot, a _stdcall function is what we in the VB world expect a dll to be using.
Hope this answers your problem!
HI all,
The probleem seems to be the version of c I have being using
VB version 6, C version 5, Fortran version 6.
If i recompile my c code in version 6 it does not give the
error anymore, but values are now incorrect ,will keep you informed.
Thanks.
Christo