Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. why my class derived from CHtmlView cannot show the 'Search' bar

why my class derived from CHtmlView cannot show the 'Search' bar

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelpannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    joshua0137
    wrote on last edited by
    #1

    i write a class derived from CHtmlView, and write the code as below, when it run, no bar appear, and a messageBox show a string '0x80040100', what is the reason? how can i make it work. any suggestion or help are appreciated

    void CXxView::OnShowBar()
    {
    IWebBrowser2 *pBrowser = NULL;
    // Ensure that our site is an browser window
    HRESULT hr = m_pBrowserApp->QueryInterface(IID_IWebBrowser2, (void **) &pBrowser);
    if (SUCCEEDED(hr))
    {
    // Display the band object (the Search bar in this case)
    VARIANT vtBandGUID, vtShow;
    vtBandGUID.vt = VT_BSTR;
    //change the CLSID as your bar CLSID
    vtBandGUID.bstrVal = SysAllocString(OLESTR("{30D02401-6A81-11d0-8274-00C04FD5AE38}"));
    vtShow.vt = VT_BOOL;
    vtShow.boolVal = TRUE;
    HRESULT hrx = pBrowser->ShowBrowserBar(&vtBandGUID, &vtShow, 0);
    if (FAILED(hrx))
    {
    CString _str;
    _str.Format("0x%x", hrx);
    AfxMessageBox(_str);
    }

    	SysFreeString(vtBandGUID.bstrVal);
    	pBrowser->Release();
    }
    

    }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups