FreeLibrary就出错,请问错在哪里,谢谢
仗剑骑驴 2011-01-20 07:58:51 typedef LONG (__stdcall * TESTFUN)(LPCTSTR , LPCTSTR );
void test()
{
HMODULE hdll = LoadLibrary("mydll.dll");
if (hdll==NULL)
{
AfxMessageBox("LoadLibrary error");
return ;
}
TESTFUN testfun=(TESTFUN)GetProcAddress(hdll,"testfun");
if(testfun== NULL)
{
AfxMessageBox("GetProcAddress error");
return ;
}
LONG rets=testfun("a1","a2");
FreeLibrary(hdll);//这里一执行就出错,去掉就一切OK,请问这是哪里写错,谢谢。。。
}