typedef int (getint)(CString str);HINSTANCE hInstance;
getint* func=NULL; int i;
CString chf; VERIFY(hInstance=::LoadLibrary("d:\\temp\\Project1.dll"));
VERIFY(func=(getint*)::GetProcAddress(hInstance,"GetInt"));
if(func==NULL)
MessageBox("get faill!");
i=(*func)("34");以上调用出错!麻烦指教!
getint* func=NULL; int i;
CString chf; VERIFY(hInstance=::LoadLibrary("d:\\temp\\Project1.dll"));
VERIFY(func=(getint*)::GetProcAddress(hInstance,"GetInt"));
if(func==NULL)
MessageBox("get faill!");
i=(*func)("34");以上调用出错!麻烦指教!
如果没有得话,你导出的函数已经被改名了,你当然得不到他的指针了。
要注意dll的调用规范和你当前进程的调用规范一致
问题出在
typedef int (__stdcall getint)(CString str);
加上"__stdcall"就可以了,这个动态库y用delphi做的。