1,extern "C" __declspec(dllexport) void ShowDlg(char* pfilepath)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CDlg dlg;
dlg.DoModal();// AfxMessageBox("filepath");
}2, char* pfilepath="C:\\test.h";
typedef void (FAR WINAPI * TESTDLL)(char*);
HINSTANCE hmod;
hmod = ::LoadLibrary ("H:\\VM\\3DViewer\\test_dll_dlg2\\Debug\\test_dll_dlg2.dll");
if(hmod==NULL)
{
AfxMessageBox("Fail");
}
TESTDLL lpproc;
lpproc = (TESTDLL)GetProcAddress (hmod,"ShowDlg");
if(lpproc!=(TESTDLL)NULL)
(*lpproc)(pfilepath);
FreeLibrary(hmod);错误:我测试参数已经传过去了,可是好像在测试程序退出时弹出错误:
File:i386\chkesp.c
The value of ESP was not properly saved across a function call.
This is usually a result of calling a function declared with one
calling convention with a funtion pointer declared with a different
calling convention.这是什么错误啊?怎么搞定啊?向大家请教!!!
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CDlg dlg;
dlg.DoModal();// AfxMessageBox("filepath");
}2, char* pfilepath="C:\\test.h";
typedef void (FAR WINAPI * TESTDLL)(char*);
HINSTANCE hmod;
hmod = ::LoadLibrary ("H:\\VM\\3DViewer\\test_dll_dlg2\\Debug\\test_dll_dlg2.dll");
if(hmod==NULL)
{
AfxMessageBox("Fail");
}
TESTDLL lpproc;
lpproc = (TESTDLL)GetProcAddress (hmod,"ShowDlg");
if(lpproc!=(TESTDLL)NULL)
(*lpproc)(pfilepath);
FreeLibrary(hmod);错误:我测试参数已经传过去了,可是好像在测试程序退出时弹出错误:
File:i386\chkesp.c
The value of ESP was not properly saved across a function call.
This is usually a result of calling a function declared with one
calling convention with a funtion pointer declared with a different
calling convention.这是什么错误啊?怎么搞定啊?向大家请教!!!
解决方案 »
- ADO方式连数据库,需要不停查询的疑惑
- 求使用MFC下载一个网页的代码
- 出现LINK : fatal error LNK1117: syntax error in option "incremental:no/pdb:Release/gobang.pdb"错误,请各位帮忙解决一下
- 如何得到Tree Control控件中复选框选中的值?
- 关于COM的一个问题
- 今晚加班,散一分,舒展心情!
- CString对象如何转化为整数类型?
- 请问那里可以下载数字签名的工具?
- 如何查看lib文件中函数的原型?
- 请各位高手引导我这个初学者吧!·#¥%……
- 我写的程序总是占用100%的CPU资源,会是什么原因引起的呢?
- 各位虾哥:关于鼠标托动图标的问题?
看看你的调用和声明是否一致。最好都用_stdcall。
extern "C" __declspec(dllexport) void WINAPI ShowDlg(char* pfilepath)
调用也用WINAPI。