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

    JSON undefined in my webbrowser container

    Hi all,
    I create an IWebBrowser2* object and attached it to new window.
    I create also a simple html page containing JScript alert(JSON) command.
    when i load the page from IE the page works fine.
    but when i load the page from my object i get JSON undefined.
    do i nead to set my object with some setting?

  2. #2
    Join Date
    Apr 2013

    Re: JSON undefined in my webbrowser container

    My code:

    ATL::CComPtr<IWebBrowser2> m_spWebBrowser;
    ATL::CAxWindow m_wndContainer;

    HWND hWnd = m_wndContainer.Create(NULL,

    if (NULL == hWnd) {
    return false;
    if (FAILED(m_spWebBrowser.CoCreateInstance(__uuidof(WebBrowser), NULL))) {
    return false;

    // associate webbrowser control with container window
    if (FAILED(m_wndContainer.AttachControl((IUnknown*)m_spWebBrowser, NULL))) {
    m_spWebBrowser = NULL;
    return false;

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

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.