yekerui wrote:
Hi, All:
I have a big trouble to get URL from XPCOM/C++/plugin. It is very simple to get URL from IE with interface IWebBrowser2. I want to do samething

What URL are you trying to get? From your sample code it looks like you're trying to create a new URL.

rv = pIComponentManager->GetClassObjectByContractID("@mozilla.org/network/standard-url;1",
NS_GET_IID(nsISupports), (void**)&pISupports);

The class object is typically the object that implements nsIFactory, and it is hardly ever necessary to call this method. You typically create new XPCOM objects by calling CreateInstanceByContractID or GetServiceByContractID.


Furthermore, I can guarantee that you don't actually want to be creating a new standardurl by hand. If you want to make a new URL, you should do so by asking the IOService to create one using the correct protocol handler (nsIIOService->NewURI).

--BDS
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to