Re: IOleInPlaceSite moveto and hosting
From: xtreem (invalid_at_hotmail.com)
Date: 10/21/04
- Next message: Igor Tandetnik: "Re: IOleInPlaceSite moveto and hosting"
- Previous message: xtreem: "Re: IOleInPlaceSite moveto and hosting"
- In reply to: xtreem: "Re: IOleInPlaceSite moveto and hosting"
- Next in thread: Igor Tandetnik: "Re: IOleInPlaceSite moveto and hosting"
- Reply: Igor Tandetnik: "Re: IOleInPlaceSite moveto and hosting"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 21 Oct 2004 19:26:38 +1000
"xtreem" <invalid@hotmail.com> wrote in message
news:41777a08$0$692$61c65585@uq-127creek-reader-02.brisbane.pipenetworks.com.au...
> Hi Igor,
>
> Thanks for your tip. Ive seen something similar posted about but cant seem
> to get it working unfortuantly. Heres my code:
>
> class mywindow : public CWindowImpl<mywindow, CAxWindow>
> {
> BEGIN_MSG_MAP( mywindow )
> MESSAGE_HANDLER( WM_CREATE, OnCreate )
> ALT_MSG_MAP(1) //????
> MESSAGE_HANDLER (WM_SIZE, OnSize ) //?????
> END_MSG_MAP()
>
> CContainedWindow m_browWnd; // ??????
> CComObject<CSiteBrowser> *pSink;
> IWebBrowser2 *pWebB;
>
> LRESULT OnCreate( UINT msg, WPARAM wp, LPARAM lp, BOOL& bHandled){
>
> CComObject<CSiteBrowser>::CreateInstance(&pSink);
> HRESULT hr = CreateControlEx(OLESTR("about:blank"), NULL, NULL, NULL,
> __uuidof(DWebBrowserEvents2),
> (IUnknown*)(IDispEventImpl<0, CSiteBrowser, &DIID_DWebBrowserEvents2,
> &LIBID_SHDocVw, 1, 1>*)pSink);
> CComPtr<IObjectWithSite> pObjSite = NULL;
> QueryHost(IID_IObjectWithSite, (void**)&pObjSite);
> QueryControl(IID_IWebBrowser2, (void**)&pWebB);
> pWebB->Navigate(OLESTR("file://c:\\test.htm"), &vtMissing, &vtMissing,
> &vtMissing, &vtMissing);
> ICustomDoc *custdoc;
> IDocHostUIHandlerDispatch *docui;
> pSink->QueryInterface(IID_IDocHostUIHandlerDispatch, (void**)&docui);
> SetExternalUIHandler(docui);
> pObjSite->SetSite(pSink->GetUnknown());
> return 0;
> }
> }
>
The following modification seems to work ok, though Im not sure if its
entirely correct.
mywindow():m_browWnd(this, 1)
{
}
OnCreate...
HWND wbh;
wbh = GetWindow(GW_CHILD);
m_browWnd.SubclassWindow(wbh);
It seems to get the OnSize events ok. I just need to work out the
ResizeVirtual functions...
- Next message: Igor Tandetnik: "Re: IOleInPlaceSite moveto and hosting"
- Previous message: xtreem: "Re: IOleInPlaceSite moveto and hosting"
- In reply to: xtreem: "Re: IOleInPlaceSite moveto and hosting"
- Next in thread: Igor Tandetnik: "Re: IOleInPlaceSite moveto and hosting"
- Reply: Igor Tandetnik: "Re: IOleInPlaceSite moveto and hosting"
- Messages sorted by: [ date ] [ thread ]