Re: nsIURI object creation failed from standard URL
Neil <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpfe |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: >While creating the nsIURI object from standard_url it is giving the NULL object. > >nsProtocolHandler class and NewURI() method we are accessing the standard_url and nsIURI object as below. > >ns_smartptr<nsIStandardURL> standard_url(nsCreateInstance("@mozilla.org/network/standard-url;1")); > >standard_url->Init(nsIStandardURL::URLTYPE_STANDARD, 80, aSpec, aOriginCharset, aBaseURI); > >ns_smartptr<nsIURI> result(standard_url); > >*_retval = result; >NS_ADDREF(*_retval); > >return NS_OK; > Out of interest, can you try the following code instead: ns_smartptr<nsIStandardURL> standard_url(nsCreateInstance("@mozilla.org/network/standard-url;1")); standard_url->Init(nsIStandardURL::URLTYPE_STANDARD, 80, aSpec, aOriginCharset, aBaseURI); return CallQueryInterface(standard_url, _retval); -- Warning: May contain traces of nuts.