PACUS
April 4th, 1999, 06:35 PM
Her my little Code, but I don't know why it isn't work ;-(
// DLL:
extern "C" void __declspec (dllexport) Get_Func(int* i)
{
*i=99;
}
//Main-PRG:
CMyProg::OpenDLL()
{
HINSTANCE hDll;
typedef void (__stdcall *LPFNDLLFUNC1)(i*);
LPFNDLLFUNC1 lpGet_Func;
hDLL=LoadLibrary ("Test.DLL");
lpGet_Func= (LPFNDLLFUNC1)::GetProcAddress(hDLL,_T("Get_Func"));
if (lpGet_Func!=NULL)
{
int i;
lpGet_Func(&i);
// Now i must be 99 but I've got the ERROR
}
FreeLibrary (hDLL);
}
ERROR:
Debug Error!
The value of ESP was not properly saved across a function call. This is....
// DLL:
extern "C" void __declspec (dllexport) Get_Func(int* i)
{
*i=99;
}
//Main-PRG:
CMyProg::OpenDLL()
{
HINSTANCE hDll;
typedef void (__stdcall *LPFNDLLFUNC1)(i*);
LPFNDLLFUNC1 lpGet_Func;
hDLL=LoadLibrary ("Test.DLL");
lpGet_Func= (LPFNDLLFUNC1)::GetProcAddress(hDLL,_T("Get_Func"));
if (lpGet_Func!=NULL)
{
int i;
lpGet_Func(&i);
// Now i must be 99 but I've got the ERROR
}
FreeLibrary (hDLL);
}
ERROR:
Debug Error!
The value of ESP was not properly saved across a function call. This is....