
Bad DLL calling convention (error 49)
Hi,
I am trying to call a DLL function that I wrote in C++ and I keep getting
error 49 - Bad DLL calling convention. The DLL function expects a pointer to
a null terminated string and returns an integer.
extern "C" __declspec(dllexport) int SetStreamDate(char *date)
{
...
return 10;
Quote:
}
This is how i declared the DLL function in VB:
Private Declare Function SetStreamDate Lib MyLib.dll" (ByVal mDate As
String) As Long
The function is called in the following way:
Dim mDate As String
...
mDate = Format(Now, "yyyy-mm-dd")
k = SetStreamDate(ByVal mDate)
The problem is that when I am debugging the application I get error 49 on
the line that calls the DLL function whereas if i compile the app into an
exe there is no problem at all. (I have no problem calling any other DLL
function from the same DLL).
Thanks
Ioannis