[Lazarus] ActiveX, TOLEControl
lacak at zoznam.sk
Wed Oct 19 14:01:40 CEST 2016
>> Hi *,
>> I need help with OCX component (not visual I guess), which I need use
>> in Lazarus application (to control another application, which
>> supplies this OCX control).
>> I have imported type library using importtl.exe (new unit was created
>> Then in program I have created instance:
>> v := CreateOleObject('SCAPS.ScSamlightClientCtrl');
>> intf := CreateComObject(CLASS_ScSamlightClientCtrl) as
> What is the type of your V or intf variable?
> I am wild guessing maybe they are not proper referenced type so the
> object is created and then immediately freed.
There is something strange behind scene. I have tried various methods:
v1 := CreateOLEObject('SCAPS.ScSamlightClientCtrl');
i := v1.scIsRunning; // exception here
v2 := CoScSamlightClientCtrl.Create;
i := v2.scIsRunning; // exception here
ax := TActiveXContainer.Create(Self);
//ax.OleClassName := 'SCAPS.ScSamlightClientCtrl';
CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IDispatch, disp);
ax.Active := True;
v := disp;
i := v.scIsRunning; // exception here
So in every case it returns exception when I try call first time
interface method ...
I am not familiar with ActiveX technology so I have no idea what is wrong ?
More information about the Lazarus