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

Thread: create webbrowser with ATL

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
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,021

    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 Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center