Delphi 动态注册卸载OCX


本文整理自网络,侵删。

 
uses ActiveX;

{$R *.dfm}
function RegisterOCX(FileName: string): Boolean;
var
  OCXHand: THandle;
  RegFunc: TDllRegisterServer;
begin
  OCXHand := LoadLibrary(Pchar(FileName));
  RegFunc := GetProcAddress(OCXHand, 'DllRegisterServer');
  if @RegFunc <> nil then
    Result := RegFunc = S_OK
  else
    Result := False;
  FreeLibrary(OCXHand);
end;

function UnRegisterOCX(FileName: string): Boolean;
var
  OCXHand: THandle;
  RegFunc: TDllRegisterServer;
begin
  OCXHand := LoadLibrary(Pchar(FileName));
  RegFunc := GetProcAddress(OCXHand, 'DllUnregisterServer');
  if @RegFunc <> nil then
    Result := RegFunc = S_OK
  else
    Result := False;
  FreeLibrary(OCXHand);
end;

相关阅读 >>

Delphi fmx检查应用程序状态更改

Delphi idhttp用法详解

Delphi toscilloscope 仿windows任务管理器cpu使用记录组件

Delphi fmx窗体中控件对齐方式介绍

Delphi得到字符串中第一个汉字的位置

Delphi gdi+基本用法总结

Delphi窗体自适应分辨率

Delphi 窗口跟随

Delphi计算md5

Delphi区分汉字和字母的函数

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...