按你的作法给你个例子, 略作修改即可用
typedef int __stdcall (TEST_DLL_FUNCTION)(char *);
{
char pszAbc[256];
memset(pszAbc, 0, sizeof(pszAbc));
memcpy(.....)
bool bReturn = false;
try
{
HANDLE hDLL_TEST = LoadLibrary("你的DLL.dll"
;
if(hDLL_TEST != NULL)
{
TEST_DLL_FUNCTION *pYouFunctionDLL = (TEST_DLL_FUNCTION *)
GetProcAddress(hDLL_TEST, "TestDLL"
;
if(pYouFunctionDLL)
{
int iReturn = pYouFunctionDLL(pszAbc);
if(iReturn == 0)
{
return true;
}
else
{
ShowMessage(".....嘻嘻....."
return false;
}
}
FreeLibrary(hDLL_TEST);
}
else
{
Application->MessageBox(
"加载你的DLL.dll error", "加载 你的DLL.dll 出错, 请检查该文件以及LDAP相关文件是否存在",
"Error",
MB_OK | MB_ICONINFORMATION);
return false;
}
}
catch(...)
{
//这里写点日志
return false;
}
}