but I found any Webbroswer control implemented IDocHostUIHandler would
render it incorrectly,
Any hint? thanks.
Big Smith
Render it incorrectly how?
If you're using IE6, it has rendering issues with certain CSS I've
found, but IE7 works fine.
Nathan
I can also confirm that my implementation of IWebBrowser2 interface also
fails to display the text and pictures in the white area on the left. I
don't have time to look at it immediately but maybe/hopefully next week. I
would be interested in the solution if you come across it before then.
Thanks
Leslie
"Big Smith" <tan...@gmail.com> wrote in message
news:O%23WVKRlP...@TK2MSFTNGP04.phx.gbl...
> IE6, IE7 render OK, but CHtmlView or CDhtmlDialog can't show the text,
>
> see attach pic.
>
> Big Smith
> "Nathan Moinvaziri" <nmoin...@gmail.com>
> :36fdaf9b-d4b2-4a2e...@i29g2000prf.googlegroups.com...
Trying waiting before taking the screenshot. That is dynamic content.
It takes time. And it does work for me doing so.
Nathan
What methods are you using to render it?
Nathan
Hi Nathan,
Is 10 minutes long enough ! Seriously, IE6 is almost instant and so I would
expect iWebbrowser2 to be of a similar time frame. Obviously my
implementation is blocking something - I just do not have time to look at
the moment.
FYI: My implementation is a modified version of the cwebpage.dll project on
Code Project. I have left a question there for other users to see if they
can spot something.
Leslie.
I guess I was wrong about it being dynamic content. I was mistaken. I
thought I was seeing something else.
But what I am not mistaken about is that it is an issue with IE6
rendering engine. With IE7 it works fine, which is what I was testing
with before. Today, I tested it with IE6 and it doesn't work. Like I
said before, IE6 has certain issues rendering CSS correctly using
atleast through the use of OleDraw. You might be able to grab the HDC
someway if you are really opposed to upgrading to IE7.
Nathan
Hi Nathan,
Just to clarify - IE6 (version 6.0.2900.2180.xpsp_sp2_gdr) *is* rendering it
correctly.
It is iWebBrowser2 that is not rendering it correctly (or should I say my
implementation of it or its surrounding interfaces). My guess is that I am
blocking something that maybe should be allowed through.
My post was just to let Big Smith know that it is not just him alone and
that he is not seeing things, but I cannot help to resolve in the next few
days (pre Christmas actually).
Leslie.
Hi Big Smith,
Did you ever resolve this problem ?
Leslie.
Hi Big Smith,
Ok, I have spent some time on this problem now and I have got a solution.
You need to implement the IDocHostUIHandler::GetExternal() and return the
iDispatch interface of the Control Hosting the Web Browser. My code is in
plain C and is a specific implementation but heres the coding steps you
need:
1. Get the Window Handle of the Control Hosting the Browser.
2. Retrieve its iWebBrowser2 interface.
3. Not sure which is correct but both work: either call
webBroswer2::get_Application() or webBrowser2::get_document() to retrieve
the iDispatch interface.
4. Return S_OK indicating we are supplying an interface.
Heres my code for reference:
HRESULT STDMETHODCALLTYPE UI_GetExternal(IDocHostUIHandler *This,
IDispatch **ppDispatch)
{
IWebBrowser2 *webBrowser2;
HWND hWndHost;
VIEW View;
VWFIELD HostID;
// Get our host window. That was stored in our _IOleInPlaceFrameEx
hWndHost = ((_IOleInPlaceSiteEx *)((char *)This -
sizeof(_IOleInPlaceSiteEx)))->frame.window;
View = vwGetView(hWndHost);
HostID = vwGetField(View, hWndHost);
/* Get the browser's IWebBrowser2 object. */
if (vwGetWebPtrs(View, HostID, &webBrowser2, 0) != S_OK)
{
*ppDispatch = 0;
return S_FALSE;
}
/* Get the IDispatch Interface. */
// webBrowser2->lpVtbl->get_Document(webBrowser2, ppDispatch);
webBrowser2->lpVtbl->get_Application(webBrowser2, ppDispatch);
if (ppDispatch == NULL)
return S_FALSE;
return S_OK;
}
Once I implemented this function, the page renders correctly :-)
Leslie.