Hi guys.
I've received a native COM ADOConnection which is stored in Variant. I would like to pass interface of this connection to the VCL wrapper TADOConnection. The problem is that either I am getting invalid typecast compiler message or acces violation.
For example:
procedure AssignNativeConnection(VCLConnection: TADOConnection; var NativeConnection: Variant);
var
VariantManager: TVariantManager;
AInterface: IInterface;
begin
AInterface := VCLConnection.ConnectionObject;
VariantManager.VarToIntf(AInterface, NativeConnection); //oops AV here!
end;
Any ideas how to solve that problem? I am using Delphi 2007.
Thanks in advance.