// ------------------------------------------------------------
// 动态链接库调用示例
// 动态链接库文件:DllTest.dll
// 函数:void Test(char* szMsg);
// ------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
typedef void __declspec(dllimport) MyTest(char*);
MyTest *LoadFunc;
HINSTANCE Dll=LoadLibrary("DllTest.dll");
if(Dll) {
LoadFunc=(MyTest *)GetProcAddress(Dll,"_Test");
if(LoadFunc)
LoadFunc("Hello me");
}
}