Re: Strange NewWindow2 behaivior



Argh! I had all of the control contianment support, I just neglected to
call SetClientSite.

Thanks Igor!

-Shawn

"Igor Tandetnik" <itandetnik@xxxxxxxx> wrote in news:#isFeJIRHHA.1000
@TK2MSFTNGP05.phx.gbl:

Shawn Edward Holland <shawn.holland@xxxxxxxxxxxxxxxxxx> wrote:
Then the main app calls this member function to create the control and
return an IDispatch pointer that is used to set ppdispVal.

****************************************************************
IDispatch* CChildWindow::CreateBrowser()
{
HRESULT hr = CoCreateInstance(CLSID_WebBrowser,
NULL, CLSCTX_INPROC_SERVER,
IID_IWebBrowser2,
reinterpret_cast<void**>(&m_spWB));

CComQIPtr<IOleObject> spOleObject = m_spWB;
HRESULT hr = spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE,
&msg, this, 0, m_hWnd, &rcClient);

WebBrowser control, like any ActiveX control, needs proper hosting. It
requires a client site object, set via IOleObject::SetClientSite.

See KB article KB192560 "How to add ATL control containment support to
any window in Visual C++"

.



Relevant Pages


Loading