Hi all,

I am writing a client GUI that is talking to a number of Java servers via
J-Integra (therefore COM) although that is really only background and not vital
to the problem.

I have written stubs for all the classes that I need from the servers so I can
build the GUI without the servers needing to be up to date or even running.My
stubs are descended from TInterfacedObject but implement stub methods for
IDispatch.

The problem boils down to storing the stub objects in a list that deals with
OLEVariants. The List uses a TCollectionItem internally, storing each added
variant inside a TCollectionItem descendant that holds onto an OLEVariant.
Adding a new item to the list looks like this:

MyList.add(aNewObject as IUnknown)

which automatically casts the IUnknown to an OLEVariant which the Add method is
expecting. The Add method assigns the OLEVariant to a newly created
CollectionItem descendant.

However! Inside the add method, before I do anything, in the Evaluate/Modify
dialog, I cast the passed OLEVariant back to an IUnknown and it informs me that
it is nil!!!!

Is this because the IDispatch interface is stubbed so therefore not a real
ActiveX object? or am I just missing something with variants? This is my first
time using them.

Any help would be great,

cheers,

Phil Middlemiss.


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to