Menu

CWebBrowser problems

2016-08-05
2016-08-14
  • Sergio Ferrari

    Sergio Ferrari - 2016-08-05

    Hi David,

    CWebBrowser has two main limitations:
    1) does not display linked images in html files
    2) it shows partially the effects of linked css files (background colors and more)
    The effects of CSS (style sheets) are shown better if they are defined within the same html file.

    I don't want to made a real web browser. I just want to use CWebBrowser as a local browser to display simple html documentation of my application.
    To do this I've dirived from CWebBrowser and overwrited the GoHome() function.

    class CLocalBrowser : public CWebBrowser
    {
    public:
        CLocalBrowser();
        void GoHome();
        void SetupHomePage(LPCTSTR hPage);
    
    protected:
        virtual void OnInitialUpdate(); 
        LPCTSTR homePage = "";
    };
    
    void CLocalBrowser::SetupHomePage(LPCTSTR hPage)
    {
        homePage = hPage
    }
    
    void GoHome()
    {
        Navigate(homePage, 0, NULL, NULL, NULL, 0);
    }
    

    Try browsing with sample application browser to some web site full of images.

    Best regards.
    Sergio

     

    Last edit: Sergio Ferrari 2016-08-05
  • David

    David - 2016-08-08

    Hi Sergio

    I'm not sure how relevant this to your post, but the home page used by CWebBrowser will be the same as the home page configured for Internet Explorer. Other settings for Internet Explorer affect CWebBrowser as well.

    Best regards,
    David

     
  • Sergio Ferrari

    Sergio Ferrari - 2016-08-08

    Hi David,

    irrespective of the set home page , I just wanted to point out that CWebBrowser not loads images.

    Best regards,
    Sergio

     
  • David

    David - 2016-08-08

    Hi Sergio,

    I'm not aware of any issues CWebBrowser has loading images. CWebBrowser succesfully loads images on all operaing systems I've tested it on - from Win98 to Windows 10. It also loads images succesfully from web sites hosted locally on a hard disc, as well as over the internet.

    CWebBrowser is a simple wrapper around the IWebBrowers2 interface, so it loads the images that IWebBrower2 can.

    Best regards,
    David

     
  • Sergio Ferrari

    Sergio Ferrari - 2016-08-11

    It works!
    Thanks for your great job, David.
    Sergio

     

    Last edit: Sergio Ferrari 2016-08-11
  • David

    David - 2016-08-14

    Thanks for the update Sergio.

    I'm pleased to hear you got the code working.

    Best regards,
    David

     

Log in to post a comment.