Hosting WebBrowser control problem. 
Author Message
 Hosting WebBrowser control problem.

Why do you need CAxWindow and ATL hosting mechanism at all? You have your
pointer to WebBrowser interface, it is already hosted by somebody (actually,
by IE proper) and displayd to the user just fine. Go ahead and use it. What
exactly are you trying to achieve?
--
With best wishes,
    Igor Tandetnik


Quote:
> Hi all.
> I'm trying to host WebBrowser control from within BHO object in following
> way:

> I have     CComQIPtr<IWebBrowser2, &IID_IWebBrowser2> m_spWebBrowser2;

> It is initialized in SetSite(IUnknown *pUnkSite) of my object    as
> m_spWebBrowser2 = pUnkSite;

> and then I want to set external dispatch interface for IE to be IDispatch
> interface of my object:

> SetSite(IUnknown *pUnkSite)
> {
>     m_spWebBrowser2 = pUnkSite;
>     if(pUnkSite)
>     {
>         CAxWindow wnd(m_hWnd);
>         CComPtr<IUnknown> pUnk;
>         if(SUCCEEDED(wnd.AttachControl((IUnknown*)m_spWebBrowser2,
&pUnk)))
>         {

if(FAILED(wnd.SetExternalDispatch(static_cast<MyDispatchInterface*>(this))))

- Show quoted text -

Quote:
>                 ERROR
>         }
>     } end of 'wnd' scope
> }

> it comes to "end of 'wnd' scope" and fails in atlwin.h line 1903:

> ...
> if(m_hWnd != NULL) // should be cleared in WindowProc
>   {
>    ATLTRACE2(atlTraceWindowing, 0, _T("ERROR - Object deleted before
window
> was destroyed\n"));
>    ATLASSERT(FALSE);  - here assertion occures !!!!!
>   }
> ...
> Where I did a mistake?
> Pay attention that I don't want to create my own WebBrowser control but to
> use the existing IE instance  - therefore AttachControl is used.

> Any suggestion will be appreciated.



Sat, 22 Feb 2003 23:27:27 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Hosting the WebBrowser Control using Visual C++/ATL does not work

2. Hosting a WebBrowser Control inside an activeX ?

3. Hosting WebBrowser control in ATL CAxWindow

4. HELP: hosting WebBrowser control

5. Hosting a WebBrowser Control inside an activeX ?

6. Changing Error Msgs while Hosting Webbrowser Control...

7. Hosting the WebBrowser control into a eVC dialog

8. Domain problems when hosting webbrowser with ATL

9. Hosting WebBrowser inside ATL COM dll - Part 2

10. Hosting WebBrowser inside an ATL COM dll

11. Hosting MSHTML or WebBrowser

12. hosting WebBrowser

 

 
Powered by phpBB® Forum Software