CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Posts
    17

    create webbrowser with ATL

    Hi,
    I'm trying to create a simple webbrowser at my app.

    code sample:
    ....
    ATL::CAxWindow m_wndContainer;
    ATL::CComPtr<IWebBrowser2> m_spWebBrowser;

    HWND hWnd = m_wndContainer.Create(NULL,
    CRect(0,0,200,100),
    (LPCTSTR)0,
    WS_CAPTION|WS_THICKFRAME|WS_OVERLAPPED|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);

    CoCreateInstance(CLSID_WebBrowser,NULL,CLSCTX_INPROC,IID_IWebBrowser2,(void**) &m_spWebBrowser);
    ...

    everything is work fine except the fact the it seems that it create an IE version 7.0 and my machine have IE 8 installed.

    it not suppose to create the IE according to my installed version?
    how do i suppose to do it?

    thanx anyone

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: create webbrowser with ATL

    Under the following registry key

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

    add a DWORD value having the name of your application that hosts the Web Browser Control.

    Set the value as stated in MSDN Library: Internet Feature Controls - Browser Emulation.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured