Can someone tell me what am I doing wrong?
TCircuitGennum=Class(TCircuit)
private
FgennCore : ARK_TLB.TCore2;
FgennLibrary : ARK_TLB.ILibrary2;
Lib : OleVariant;
public
Constructor Create; override;
Destructor Destroy; override;
end;
constructor TCircuitGennum.Create;
Lib := 0;
FgennCore := ARK_TLB.TCore2.Create(nil);
FgennLibrary := FgennCore.Libraries[Lib].CreateObject as ILibrary2;
end;
As the message says the CoInitialize procedure that initializes
the COM/OLE engine for the specified application/Thread has not
been cal prior to creating the OLE objects in your application.
The CoInitialize procedure is locate inside the ActiveX unit if my
memory serves me correctly. I would suggest to call it inside your
constructor and do not forget to cal CoUninitialize in your
destructor.
As far as I can remember it is ok to call this procedures as many
times as you like inside a thread/process as long the same number
of call is made to coUninitialize although calling it only once is enough.
Regards
Yannis.