• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 311
  • Last Modified:

How do I call DllRegisterServer() safely?

I want to call DllRegisterServer() to register Indeo (IR50_32.DLL)...how do I make the call safely..and repress the RegSrv32 successful dialog box from comming up when its done?
0
hyperzapper
Asked:
hyperzapper
  • 2
  • 2
1 Solution
 
hyperzapperAuthor Commented:
Edited text of question.
0
 
interCommented:
Hi there,
feed the following proc with the file name


procedure RegisterDLL(FileName : string);
type
  TRegProc = function : HResult; stdcall;
var
  LibHandle : THandle;
  RegProc : TRegProc;
begin
  LibHandle := LoadLibrary(PChar(FileName));
  if LibHandle = 0 then ShowMessage('Could not open library');
  try
    @RegProc := GetProcAddress(LibHandle, 'DllRegisterServer');
    if @RegProc = Nil then
      ShowMessage('Could not find DLLResgiterServer');
    if RegProc <> 0 then
      ShowMessage('Could not register DLL');
  finally
    FreeLibrary(LibHandle);
  end;
end;


regards, igor
0
 
hyperzapperAuthor Commented:
Marvolous!  Nice clear routine...thanks
0
 
interCommented:
Thank you,

Note : if you want to unregister just change DLLregisterserver to string to unregister equivalent.

regards, igor
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now