Virtual Developer Workshop: Containerized Development with Docker


Hello from Greece.

My Browser.zip is showing an easy way to create a web browser. It uses Microsoft's ActiveX control for that purpose. There is already an example in the site, but i think mine is easier. That's because i use the Wizard to create the CWebBrowser class. As you see all we need to do is:

0. Add the Web Browser ActiveX control to the project. The AppWizard creates the CWebBrowser class for us.

1. We must create an instance of a CWebBrowser when OnCreate() Event occurs in our View class.

2. Use the OnSize() Event to size our control so that it covers the whole application's window.

3. Add some navigation buttons to the toolbar, with the appropriate handlers.

The job is very easy done because the AppWizard is creating the CWebBrowser class for us.

ATTENTION: The example code loads the a.htm, which must be at the same folder as the program.

The example code cannot be executed from the VC environment because it receives a wrong directory when, it calls the GetCurrentDir(), inside OnCreate() function and it cannot load the a.htm page.

Bye from Greece - Panagiotis.

Download Sample (59 kb)

Article added on June 21 1998


  • How to implement search functionality in given example.

    Posted by Uday on 03/20/2014 05:26am

    I am Looking for search functionality in browser control, when i type a keyword and click on search it should highlight the matching words in browser displayed content.

  • good

    Posted by chenghaiquan on 03/31/2009 05:50am

    That's just what I needed. But it's a little simple!

  • Load HTML from Resources

    Posted by Legacy on 11/11/2003 08:00am

    Originally posted by: Nikitin_aka_KRoL

    How i can load html pages from resources?
    Using CWebBrowser;

  • Modify HTML data itself?

    Posted by Legacy on 08/21/2002 07:00am

    Originally posted by: Todd Rhodes

    I enjoyed learning from this; Thanks. If one wanted to make systematic translations to any browsed HTML files (i.e. colors, fonts, etc.) in real time prior to displaying them, what would be the easiest way to incorporate this? Is there an HTML class that has this built in, or would I have to build some sort of filter/mangler to operate on the HTML prior to displaying it?

  • IP address option

    Posted by Legacy on 02/06/2002 08:00am

    Originally posted by: alan

    I was wanting to stick an IPAddress control on the url dialog and insert an IP instead of a URL.

    Not sure how to do this as Navigate() only takes URL.

    And CIPAddressCtrl::GetAddress() returns a dword.

    any ideas?

  • Copy&Paste problem

    Posted by Legacy on 07/30/2001 07:00am

    Originally posted by: Uwe

    Hi the Example is a great work. But copy & paste doesn't works. Ctrl-C / Ctrl-V and the the Exec()-Method whit the OLECMDID_COPY Prop doesn't works.

    Any Idea ?



  • Need the Guru's comment!

    Posted by Legacy on 06/13/2001 07:00am

    Originally posted by: Yasuhiko Yoshimura

    This article is very great and useful.

    But I would like to get a working knowledge of IE5.5 hosting method for my active-x control.
    My active-x control is a DLL that manages document files ,prints them and previews them.
    I would plan to make IE5.5 control my active-x control like the Acrobat Reader4.0 that does show PDF documents delivered from any web site.

    I hope good ideas.

    Yasuhiko Yoshimura

  • How to intercept the contents of Homepage before showing in the IE browser without proxy?

    Posted by Legacy on 02/20/2001 08:00am

    Originally posted by: Yung-Ming Kuo

    Dear friends:

    I want to intercept and get the contents(including text and image) of homepage from Web server ,before it shows the IE browser(version 5.0).But it is not through proxy.

    And i have ability to prevent HTML document from showing the browser.

    Could you offer some suggestion or source code sample to solve my question?

    Thank you ^_^


    by Kuo

  • Very good work,

    Posted by Legacy on 11/13/2000 08:00am

    Originally posted by: ArunJose

    very nice work I was able to do the same with a dialog too.Thank u.

  • Works only on the computer on which this code is compiled ?

    Posted by Legacy on 09/12/2000 07:00am

    Originally posted by: Christophe Guibert

    I've compiled/linked this code in Windows 98 and it works fine. Thanks.

    But when I copy the EXE on another PC (with the same operating system and Visual C++ installation) :
    the program crashes on this new PC while initializing OLE.

    I've tried with various configurations (WinNT 4 and tried IE3 and IE4 CLSIDs) without success.

    Program would work only when compiled on the final target machine...

    Could anyone give help or advices on that subject, seemingly related with ActiveX ?



  • Loading, Please Wait ...

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date