# VBForums CodeBank > CodeBank - Other >  [DELPHI] - Registering OCX Files?

## Madboy

```
uses
  OLECtl;

var
  OCXHandle: THandle;
  RegFunc: TDllRegisterServer;
begin
  OCXHandle:= LoadLibrary ('C:\Windows\System\FileName.ocx');
  RegFunc:= GetProcAddress (OCXHandle, 'DllRegisterServer');
  if RegFunc <> 0 then
    ShowMessage('Failed to register');
  FreeLibrary (OCXHandle);
end;
```

----------

