HINSTANCE Hdl;
int __stdcall (*ShowPage)();
//定义函数原型
AnsiString disExeFile = ExtractFileDir(Application->ExeName)+
"\ProjectDLL.dll";
Hdl = ::LoadLibrary(disExeFile.c_str());
//载入DLL
if(Hdl !=
NULL) {
ShowPage = (
int __stdcall (*)())::GetProcAddress(Hdl,
"ShowPage");
//获取函数入口地址
if(ShowPage !=
NULL)
{
ShowPage() ; //调用DLL中函数
}
else
{
ShowMessage("不能找到函数入口!");
}
::FreeLibrary(Hdl);释放DLL
}
else
{
ShowMessage("不能载入DLL!");
}
//-----------------------------------------------------------------------//
#pragma argsused
extern "C" __declspec(dllexport)
int __stdcall ShowPage();
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned
long reason <a href=
"http://www.ticketcitybowl.com/">Viagra 100mg</a>,
void*
lpReserved)
{
return 1;
}
//---------------------------------------------------------------------------
extern "C" __declspec(dllexport)
int __stdcall ShowPage()
{
AnsiString strInifile = ExtractFilePath (Application->ExeName) +
"config.ini";
TIniFile * ini =
new TIniFile(strInifile);
//AnsiString s = ini->ReadString("patient","DetailID","");
AnsiString s =
"VD-0000-20131017-1008243";
TFrm_VisitPage * vp =
new TFrm_VisitPage(NULL,s);
vp-&
gt;ShowModal();
delete vp;
vp =
NULL;
delete ini;
ini =
NULL;
return 0;
}
转载于:https://www.cnblogs.com/luyuxibaby/p/5217324.html
相关资源:BCB建立及调用DLL