Registrar un ActiveX sin utilizar RegSvr32.exe
Código Delphi
[-]
var
i : TCLSID;
hOCX : integer;
pReg : procedure;
begin
try
i := StringToClassID('SoftwareFX.ChartFX.20');
except
hOCX := LoadLibrary( 'CFX32.OCX' );
if (hOCX >= HINSTANCE_ERROR) then begin
try
pReg := GetProcAddress(hOCX,'DllRegisterServer');
if (@pReg <> nil) then
pReg
else
MessageDlg('Error in registering OCX control.');
finally
FreeLibrary(hOCX);
end;
end else
MessageDlg('Error in loading OCX control.', mtError, [mbok],0);
end;
Application.Initialize;