这个dll调用错在哪里???
调用:
HINSTANCE m_hInst_Ex;
m_hInst_Ex = LoadLibrary(".\\Moduals\\order.dll");
typedef int* ShowTDialog(CString strSeatCode);
ShowTDialog* dFun;
m_hInst_Ex = LoadLibrary(".\\Moduals\\order.dll");
if(m_hInst_Ex == NULL)
{
AfxMessageBox("Not found file.(\\moduals\\order.dll)");
return;
}
dFun = (ShowTDialog*)GetProcAddress(m_hInst_Ex,"ShowThisDialog");
if((ShowTDialog*)NULL == dFun)
{
AfxMessageBox("File not fixed.");
return;
}
*dFun(strSeatCode);
FreeLibrary(m_hInst_Ex);
DLL输出函数没有问题。以下:
extern "C" __declspec(dllexport) int ShowThisDialog(CString strSeatCode)
{
AFX_MANAGE_STATE(::AfxGetStaticModuleState());
COrderDlg dlg;
dlg.DoModal();
return 0;
}
每次都是中断在ntdll.dll那里……都给弄糊涂了~~不知道哪里找原因了,中断出来的都是汇编指令。