Re: Getting NavigateError with HTTP_STATUS_OK? - Resolved, any comments on what I found?
From: Dave Brown (man_at_c&a.)
Date: 03/16/04
- Previous message: Charles Law: "UniqueID Does Not Generate a Unique ID"
- In reply to: Dave Brown: "Getting NavigateError with HTTP_STATUS_OK?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 16 Mar 2004 15:07:45 +0000
1: I've got a hosts file that redirects ad.doubleclick.net to 127.0.0.1.
2: The sites I mentioned have got frames which attempt to load from there, so
those frames won't load. If I run IE then I get "The page cannot be found" in
those frames, which is of course what you'd expect.
3: The scenario was that my IWebBrowser2 control is ONLY displaying that frame,
and not going on to display the rest of the page.
So I spent the next 3 days hacking away. I found, of course, that if I build an
MFC sample and use the IWebBrowser2 control, everything is fine. However, for
reasons too boring to go into, I cannot go down that route.
I then found out what was going on.
What I'm writing is a general purpose "view everything" application. You tell it
to display a video or any kind of multimedia file, it uses DirectX to render it.
You tell it to display a web page, it uses the IWebBrowser2 control. In both
cases, I'm providing my own window to host the result in.
So, if my app was called MyApp.exe, you do this:
C:\>MyApp movie.mpg
or
C:\>MyApp http://www.microsoft.com
The way it works internally is it passes the argument to an
IGraphBuilder::RenderFile. If that fails, it then passes it to an
IWebBrowser2::Navigate.
I found that if I *didn't* pass it to IGraphBuilder::RenderFile, but instead
passed it straight to IWebBrowser2::Navigate, the whole thing works fine. And it
is just the RenderFile that causes the problem - not my implementation of it. I
simply commented out the call to RenderFile (leaving all the rest of the ole
stuff like CoCreateInstance), replaced it with a "return same errorcode that
renderfile returns" and hence ran the rest of the code just fine, and the
problem goes away.
The reason I don't just check for http: at the start (and hence skip attempting
to play it using IGraphBuilder) is that I need to support streaming media, and
IGraphBuilder does this. I suppose I can check for the file extension instead.
So basically, I think this is a bug somewhere, and it goes along the lines of
this:
If you have a web page containing frames and you pass its address to
IGraphBuilder::RenderFile and it fails, then you pass its address to
IWebBrowser2::Navigate then only the first frame gets displayed.
Something like that, anyway. Whether the bug is in IGraphBuilder or
IWebBrowser2, I don't know, but I'm at a loss as to what one has to do with the
other.
- Previous message: Charles Law: "UniqueID Does Not Generate a Unique ID"
- In reply to: Dave Brown: "Getting NavigateError with HTTP_STATUS_OK?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|