DLL中
extern _declspec(dllexport) int test(CString str)
{
//AfxMessageBox(str);
CPdfMenuDlg pdf;
pdf.DoModal();
return 1;
}
EXE中
_declspec(dllimport) int test(CString str);
typedef int ( *_TEST)(CString str);
void CUsedllDlg::OnOK()
{
CString str="test dll";
HINSTANCE hLibrary;
_TEST testdll;
hLibrary=LoadLibrary("c:\\dlltest.dll");
testdll=(_TEST)GetProcAddress(hLibrary,"test");
//DWORD dwError = GetLastError();
int aa=(*testdll)(str);
//FreeLibrary(hLibrary);
//CDialog::OnOK();}
出错,为什么?
extern _declspec(dllexport) int test(CString str)
{
//AfxMessageBox(str);
CPdfMenuDlg pdf;
pdf.DoModal();
return 1;
}
EXE中
_declspec(dllimport) int test(CString str);
typedef int ( *_TEST)(CString str);
void CUsedllDlg::OnOK()
{
CString str="test dll";
HINSTANCE hLibrary;
_TEST testdll;
hLibrary=LoadLibrary("c:\\dlltest.dll");
testdll=(_TEST)GetProcAddress(hLibrary,"test");
//DWORD dwError = GetLastError();
int aa=(*testdll)(str);
//FreeLibrary(hLibrary);
//CDialog::OnOK();}
出错,为什么?
解决方案 »
- 向高手请教,离散点,如何求近似直线或者最优化直线,谢谢!
- 菜鸟请教:如何得到两个日期之间的周末的天数?
- 请高手来帮我看看,难道VC疯了吗?
- 动画框怎么加人菜单
- 怎么样等待这个线程结束?
- 高级编程挑战:编写windows下的无线局域网sniffer
- 电子钟表
- 请问怎么用tab control,还有已经做好的对话框上的按钮放到TAB control上就失效了?
- james_razor(蹬三轮的),有一个问题要跟你商榷 。其他同志勿进来
- 哪位知道,我在win2000下开发的程序在win98运行怎么有些字体显示是乱码?但字体win98也存在
- 有关SDK的问题
- 如何向子窗体(Model)发消息???在线!!!!
{
MFCDLL;
CShowInDllDlg dlg;
dlg.DoModal();
}