15,471
社区成员
发帖
与我相关
我的任务
分享
//---------------------------------------------------------------------------
// 注册com组件,reg为true注册,false注销
//---------------------------------------------------------------------------
bool __fastcall DllRegServer(const String &dllName, bool reg)
{
HINSTANCE module;
int __stdcall (*fun)(void);
module = LoadLibrary(dllName.c_str());
if (reg)
fun = GetProcAddress(module, "DllRegisterServer");
else
fun = GetProcAddress(module, "DllUnregisterServer");
if (fun == NULL)
{
FreeLibrary(module);
return false;
}
else
{
fun();
FreeLibrary(module);
return true;
}
}