> I am writting a program that uses COM interfaces.
> A VI obtains a COM interface from the DLL server and is
> attempting to cache the interface pointer for use with other
> VIs. But when the other VI tries to use the interface,
> the interface pointer is no longer valid. Why ?
>
> I confirmed that the object the interface is pointing is still
> active, but I can"t see why an interface pointer can't be used
> between multiple VIs.
>
This is something that can happen with any form of I/O refnum
in LV. They are garbage-collected whenever the top-level VI
that they were allocated as a part of finishes running.
To resolve your specific question, you can write a refnum into
a global or whatever else for storage and use it as long as the
top-level VI that it was all
ocated on behalf of is still running.
When the VI finishes, the references are all released, and any
actions on those refnums should return an error.
Notice that the refnum isn't the same as an interface pointer.
The interface pointer is stored in a table for garbage collection,
and the refnum points to that.
I hope this clears things up.
Greg McKaskle