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();}
出错,为什么?