在mdi中调用在Dll中的child窗方式如何?
ljlln 2003-10-10 10:15:20 调用处:
HINSTANCE DLLInst = NULL;
String sDllNameAndPath=ExtractFileDir(Application->ExeName)+"\\ChildDll.dll";
if(!FileExists(sDllNameAndPath))
{
return ;
}
DLLInst = LoadLibrary(sDllNameAndPath.c_str());
//int(__stdcall *UpdateIntFace)(String sFilePath );
int (__stdcall *ShowForm) (TApplication* Owner) ;
if (DLLInst == NULL) return ;
ShowForm = (int(__stdcall *)(TApplication* Owner))GetProcAddress(DLLInst,"ShowForm");
try
{
ShowForm(Application) ; //导入成功 返回1 失败返回0 ;
}
catch(...)
{
FreeLibrary(DLLInst);
return ;
}
FreeLibrary(DLLInst);
return ;
dll中的接口函数:
extern "C" __declspec(dllexport) int __stdcall ShowForm(TApplication* Owner) ;
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
//---------------------------------------------------------------------------
int __stdcall ShowForm(TApplication* Owner)
{
new TForm2(Owner) ;
}
老用问题!应该如何调用、谢谢!