DLL中只有对话框和一个打开它的导出函数。
#pragma comment(linker,"/export:ShowDlg=_ShowDlg@8")
int __stdcall ShowDlg(int PlayerId,char* PlayerName)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

CDlg dlg;
dlg.SetPlayer(PlayerId,PlayerName);
dlg.DoModal();

return 0;
}
调用:
typedef int (ShowDlg)(int id,char* sz);
HINSTANCE hInstance;
ShowDlg* fun;
hInstance = ::LoadLibrary("ChatClientDLL.dll");
fun = (ShowDlg*)::GetProcAddress(hInstance,"ShowDlg");
int sum = (*fun)(123,"aaa");   //此处断言错
不知道哪儿错了,该怎么改呀?