When I attempt to run the following function,I got the following the error.Otherwise,When completing the process of function,I’m receiving the error.
Debug error!
The value of ESP was not properly saved across a function call.
This is usually a result of calling a function declered with one calling
convention with a fonction pğointer declered with a different calling convention.
Code:
typedef int(*FPROC)(char*,char*,char*,char*,char*,int,int);
HINSTANCE hDllInstance;
FPROC pmyfonk;
hDllInstance = LoadLibrary(TEXT("mydll.dll"));
if (hDllInstance==NULL) {MessageBox("...dll yok............");
exit(0);
}
pmyfonk=(FPROC)GetProcAddress(hDllInstance,TEXT("myfonk"));
pmyfonk(TEXT("xxx"),TEXT("xxy"),TEXT("xxz"),NULL,TEXT("xy"),1,1);//this function is working.But,I'm getting upper error.
FreeLibrary(hDllInstance);
You should check this out: http://msdn.microsoft.com/en-us/library/k2b2ssfy.aspx
There is a mismatch between calling convention somewhere in your code. I’m new to windows programming so I don’t know much more but this is clearly what the error message tells.