One correction:
I did google search, but I can NOT get any clues about getting URL from
XPCOM/C++.
"yekerui" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi, Benjamin:
> Thanks a lot for your response!
> All I want is to query URL on a mozilla browser without creating a new
> URL. However, I can not find a way to query URL after looking through all
> of interface definitions in the directory ..\gecko_sdk\idl\. Could you
> give me a hint how to get an URL address like http://www.firefox.com
> displayed on browser. I did google search, but I can get any clues about
> getting URL from XPCOM/C++.
> Again, thanks a lot for your help.
>
>
> Regards
>
>
>
> "Benjamin Smedberg" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> 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