Neil Stansbury wrote:
Just thought I'd add, in JS you can also:

if ( O1 instanceof Components.interfaces.O2 )    {
    // Do stuff
}

O1 is implicity cast on success

The above is a bit misleading in the context of the OP's question. What you say is absolutely true if 'O2' is the name of an xpcom interface. But, in the original question I took 'O2' to be an arbitrary object - in which case your code snippet would not work.

John.



N



John Bandhauer wrote:

Oliveiros Cristina wrote:

All,

Can anyone advise me if the identity rules that applied in MSCOM apply as well in XPCOM? Namely, if we query a certain object O1 for nsISupports interface and store pointer in p1 and query O2 for nsISupports and store pointer in p2

If O1 == O2  implies that p1 == p2   ?


Yes.


If this rule doesn't hold how can we test if two interface pointers refer to the same component ?

Thanks in advance for your help

Oliveiros Cristina
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to