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 successfully)

Then in program I have created instance:
  v := CreateOleObject('SCAPS.ScSamlightClientCtrl');
intf := CreateComObject(CLASS_ScSamlightClientCtrl) as _DSamlight_client_ctrl_ocx;

But all next attampts using any interface method fail with EOleSysError "Catastrophic failure" (ErrorCode=-2147418113)

In Delphi it works, but only when I use TOLEControl descendant created by Delphi's import of ActiveX (into _TLB unit)
In Delphi I have :

TScSamlightClientCtrl = class(TOleControl)

but in Lazarus I have no equivalent? (When I Delphi I do same as in Lazarus I get same error also in Delphi)

I do not know exacly what to ask here ?
What is purpose of TOleControl and what TOleControl did more than I can do in Lazarus ?
Can I somehow workaround it in Lazarus ?

In short what I have imported from type lib in Lazarus is interface:
 _DSamlight_client_ctrl_ocx = dispinterface
   function ScIsRunning:Integer;dispid 1;
  ... etc.

and CoClass:
  Class Function CoScSamlightClientCtrl.Create: _DSamlight_client_ctrl_ocx;
Result := CreateComObject(CLASS_ScSamlightClientCtrl) as _DSamlight_client_ctrl_ocx;

I can create instance calling CoScSamlightClientCtrl.Create, but as I wrote I can not use any method ...

Can somebody give any help ?



Lazarus mailing list

Reply via email to