On Thu, Sep 09, 2004 at 04:48:14PM -0400, Nathan White wrote:
> I have tried:
> 
> if (  Components.classes['@mozilla.org/dictionary;1'].equals(result) )
> 
> but this doesn't work what am I doing wrong?

You can not check whether an object is an instance of a particular
contract id. You can check whether it supports a particular interface
though:

  if (result instanceof Components.interfaces.nsIFoo) {
      result.foobar();
      // ...
  }

or:
  try {
    var foo = result.QueryInterface(Components.interfaces.nsIFoo);
    foo.foobar();
    // ...
  } catch (e) {
    // No nsIFoo.
  }
-- 
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to