动态调用例子:
void __fastcall TFormmain::Button1Click(TObject *Sender)
{
if(hMyInst==NULL) //在头文件中private声明:HINSTANCE hMyInst;
{
hMyInst=LoadLibrary("CopyRigthPro.dll");
if(hMyInst==NULL)
throw Exception("装载文件CopyRigthPro.dll失败!");
}
TForm * (*FormNew)();
TForm *p;
(FARPROC) FormNew=GetProcAddress(hMyInst,"NewForm");//你的DLL中的函数‘NewForm’
p=FormNew();
p->ShowModal();
}