现在的位置: 首页 > 综合 > 正文

Delphi实现注册dll文件

2014年02月25日 ⁄ 综合 ⁄ 共 531字 ⁄ 字号 评论关闭

type
  TDllRegisterServer=function:HResult; stdcall;

 

Procedure RegisterDll(DllName: String);
Var
  h: HModule;
  Ocx: TDllRegisterServer;
Begin
  h := 0;
  Try
    h := LoadLibrary(PChar(DllName));
    If h = 0 Then
    Begin
      Application.MessageBox(PAnsiChar('注册' + DllName + '失败!请检查该文件是否存在!'), '提示', MB_ICONERROR);
    End
    Else
    Begin
      @Ocx := GetProcAddress(h, 'DllRegisterServer');
      Ocx;
    End;
  Except
    Application.MessageBox(PAnsiChar('注册' + DllName + '失败!请检查该文件是否存在!'), '提示', MB_ICONERROR);
  End;
  FreeLibrary(h);
End;

 

 

www.taoyou100.cn  淘友100 满意100,提供给您最信赖的网络购物享受。

抱歉!评论已关闭.