关于DLL动态调用
我用静态调用时,可以显示出Form,可是动态调用时,就说找不到DLL中函数的指针,onClick事件代码如下:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
HINSTANCE hInst;
if(hInst == NULL)
{
hInst = LoadLibrary("Project2.dll");
}
if (hInst!=NULL)
{
(FARPROC &)displayForm = GetProcAddress(hInst,"inputinterface");
if (displayForm!=NULL)
{
displayForm();
}
else
{
ShowMessage("无法获取调用函数的指针");
} }
else
{
ShowMessage("无法载入DLL文件");
}
//TForm2* temp = new TForm2(NULL);之前用的静态调用
//temp->inputinterface();之前用的静态调用
}