dll调用总是报错
在DLL中一个弹出对话框的函数,总是报错
//DLL中的一个函数
BOOL WINAPI show(HWND hWnd){
DialogBox(hInst, (LPCTSTR)IDD_OPTION , hWnd, (DLGPROC)Test);
return TRUE;
}
//程序通过下述方法调用
BOOL WINAPI DoDockSetDialog(HWND hWnd){
typedef BOOL(*SHOW)(HWND);
SHOW show;
HINSTANCE hDll=NULL;
hDll=LoadLibrary("Option.dll");
show=(SHOW)GetProcAddress(hDll,"show");
show(hWnd);
FreeLibrary(hDll);
return TRUE;
}
错误为
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 function pointer declared with a different calling convention .
不过把传入参数删掉就可以,但我需要一个模态的对话框,请问如何解决?