Hi,
how should one use TInterfaceList with other interfaces than IUnknown?
Let's say we have a ISomeInterface derived from IUnknown.
When we have an ISomeInterface, we can add it to the list fine, because
an ISomeInterface is an IUnknown.
But when we get it back from the list, it is an IUnknown and not an
ISomeInterface.
Writing (list.get(0) as ISomeInterface), is very slow and not possible,
when the interface has no GUID.
Writing ISomeInterface(list.get(0)) usually works fine, but when -CR is
set, it does not compile.
Writing ISomeInterface(pointer(list.get(0))) appears to work, but is
that safe, or does it confuse the reference counting?
Or perhaps it is better to use gvector rather than TInterfaceList?
Best,
Benito
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal