CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

Become a Marketplace Partner

jobs.internet.com

internet.commerce
Partners & Affiliates
















RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

Home >> Visual C++ / C++ >> Internet & Networking >> Internet Protocols >> Browser Control


Another example of using the Web Browser control
Rating: none

Panagiotis Piperopoulos (view profile)
August 7, 1998

.

Hello from Greece.
(continued)



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

Tools:
Add www.codeguru.com to your favorites
Add www.codeguru.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed







RATE THIS ARTICLE:   Excellent  Very Good  Average  Below Average  Poor  

(You must be signed in to rank an article. Not a member? Click here to register)

Latest Comments:
Load HTML from Resources - Legacy CodeGuru (11/11/2003)
Modify HTML data itself? - Legacy CodeGuru (08/21/2002)
IP address option - Legacy CodeGuru (02/06/2002)
Copy&Paste problem - Legacy CodeGuru (07/30/2001)
Need the Guru's comment! - Legacy CodeGuru (06/13/2001)

View All Comments
Add a Comment:
Title:
Comment:
Pre-Formatted: Check this if you want the text to display with the formatting as typed (good for source code)



(You must be signed in to comment on an article. Not a member? Click here to register)


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers