Here is the snippet I cannot have it work. It's a client code. I don't write
my own XPCOM component.

nsCOMPtr<nsIServiceManager> servMan;
      rv = NS_InitXPCOM2(getter_AddRefs(servMan), nsnull, nsnull);
      if (NS_FAILED(rv))
      {
       }

      nsCOMPtr<nsIComponentRegistrar> registrar =
do_QueryInterface(servMan);
    //it always fail here when I call AutoRegister();
      rv=registrar->AutoRegister(nsnull);

nsCOMPtr<nsICookieManager> cookieManager;
//this is also failed
rv = servMan->GetServiceByContractID("@mozilla.org/cookiemanager;1",
                            NS_GET_IID(nsICookieManager),
                             getter_AddRefs(cookieManager));

I guess I am wrong in using these methods. I try to register all default
XPCOM components installed with firefox.
In fact I want to use the components installed from firefox which resides on
the C:\program files\mozilla firefox

What's the right procedure?

Thanks very much for help!

John


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

Reply via email to