Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us
|
How to register an OCX
This article has not been rated yet. After reading, feel free to leave comments and rate it.
Your installation program needs to register an OCX, but doesn't support this? Or you want to
register it by your program yourself?
Suppose the OCX you want to use is called Test.ocx
 | |  | | program RegisterMyOCX;
uses
OLECtl, Windows, Dialogs;
var
OCXHand: THandle;
RegFunc: TDllRegisterServer; begin
OCXHand:= LoadLibrary('c:\windows\system\test.ocx');
RegFunc:= GetProcAddress(OCXHand, 'DllRegisterServer'); if RegFunc <> 0 then
RegFunc
else
ShowMessage('Error!')
FreeLibrary(OCXHand);
end. | |  | |  |
Comments:
|