我按
http://www.vckbase.com/document/viewdoc/?id=543
做了一个动态连接库,然后调用.结果出错了.
DLL连接库的程序:
extern "C" __declspec(dllexport) void Show(int i)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

}什么都没有做,只做了一个参数的传递.调用程序:
typedef void (WINAPI * TESTDLL)(int i);int i=0;
HINSTANCE hmod;
hmod = ::LoadLibrary ("mfcdll.dll");
if(hmod==NULL)
{
AfxMessageBox("Fail");
}
TESTDLL lpproc;
lpproc = (TESTDLL)GetProcAddress (hmod,"Show");
if(lpproc!=(TESTDLL)NULL)
(*lpproc)(i);
FreeLibrary(hmod);
出错消息:
The value of ESP was not properly saved across a function call This is usually a result of calling a function declare with one calling convention with a function pointer declare with a different calling convention  怎么回事?