Mega Code Archive

 
Categories / Delphi / Activex OLE
 

Registering an ocx

uses OLECtl; var OCXHand: THandle; RegFunc: TDllRegisterServer; begin OCXHand := LoadLibrary ('C:WindowsSystemcustom.ocx'); RegFunc:= GetProcAddress (OCXHand, 'DllRegisterServer'); if RegFunc <> 0 then ShowMessage('Error!'); FreeLibrary (OCXHand); end; {Or you may easily register your custom ocx file with the following line:} WinExec(PChar('regsvr32 /s custom.ocx'),SW_HIDE);