Register a OCX in Windows  

Send By: Radikal (Q3 Team)
Web : http://www.q3.nu
Email: radikal@q3.nu
Date: 02/10/99

Tip accessed 456 times

 


We can make it executing RegSvr32.Exe, or with this code into our application:


 procedure TForm1.Button1Click(Sender: TObject);

 type
   TDLLRegisterServer   = function: HResult stdcall;
 var
   MangoOCX  : THandle;
   Registrar : TDllRegisterServer;
 begin
   {Cargamos el OCX}
   {Load the OCX}
   MangoOCX:= LoadLibrary('c:\windows\system\html.ocx');
   {Hallamos la direccion de la funcion para registrar el OCX}
   {Get the address to register the OCX}
   Registrar:= GetProcAddress(MangoOCX, 'DllRegisterServer');
   {Llamamos a la función}
   {Call to the function}
   if Registrar <> 0 then ShowMessage('Error');
   {Liberamos el OCX}
   {Free the OCX}
   FreeLibrary(MangoOCX);
 end;