I'm trying to OpenURI from XPCOM component and always get thread disappeared in
nsIIOService::NewChannelFromURI.
Maybe there is a sample code how to open document in specific frame?
I can't get what I'm doing wrong.
I'm using Mozilla0.8.
Here is how I am trying to do this:

nsCID URI_CID = NS_SIMPLEURI_CID;
nsCID IOSERVICE_CID = NS_IOSERVICE_CID;
char* URILOADERSERVICE_CID = "@mozilla.org/uriloader;1";

nsIIOService* ios = nsnull;
nsIURI* uri = nsnull;
nsIChannel* channel = nsnull;
nsIURILoader* uriloader = nsnull;
nsresult rv;

rv = nsComponentManager::CreateInstance(URI_CID, nsnull, NS_GET_IID(nsIURI), 
(void**)&uri);
uri->SetSpec((char*)szURL);
rv = nsServiceManager::GetService(IOSERVICE_CID, NS_GET_IID(nsIIOService), 
(nsISupports**)&ios);

rv = ios->NewChannelFromURI(uri, &channel); // <------------- thread does not return 
back from this call

rv = nsServiceManager::GetService(URILOADERSERVICE_CID, NS_GET_IID(nsIURILoader), 
(nsISupports**)&uriloader);
rv = uriloader->OpenURI(channel, nsIURILoader::viewNormal, (char*)frame, 
(nsIDocShell*)DS);




Reply via email to