VC写的DLL对话框界面,里面加了几个IE控件,怎么调用不成功啊
VC写的DLL对话框界面,里面加了几个IE控件,怎么调用不成功啊
这是调用的程序:
void CTestDlg::OnButton1()
{
// TODO: Add your control notification handler code here
typedef void (WINAPI * TESTDLL)();
HINSTANCE hmod;
hmod = ::LoadLibrary ("11.dll");
//hmod = ::LoadLibrary ("Yc.HuangXiao.FrameWork.WebControls.dll");
if(hmod==NULL)
{
AfxMessageBox("Fail");
}
TESTDLL lpproc;
lpproc = (TESTDLL)GetProcAddress (hmod,"Show");
if(lpproc!=(TESTDLL)NULL)
(*lpproc)();
FreeLibrary(hmod);
}
这是DLL里的相关代码:
extern "C" __declspec(dllexport) int Calc(int x)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CNJN dlg;
dlg.DoModal();
return 2*x;
}
BOOL CMy11App::InitInstance()
{
// TODO: Add your specialized code here and/or call the base class
AfxOleInitModule();
AfxEnableControlContainer();
return CWinApp::InitInstance();
}
怎么回事啊