Select the product you need help with
HOW TO: Display HTML Using the WebBrowser Control in a Visual C++/MFC ApplicationArticle ID: 315617 - View products that this article applies to. This article was previously published under Q315617 On This PageSUMMARY
This step-by-step article explains how you can use the WebBrowser control to incorporate HTML displays in a C++ program that uses the Microsoft Foundation Classes (MFC) framework. You can reuse the WebBrowser component of Internet Explorer 4.0 in programs to display HTML. Microsoft Visual C++ 6.0 contains additional functionality that makes re-use of this component simple. RequirementsThe following list outlines the recommended hardware, software, network infrastructure, and service packs that are required:
Create an MFC View Based on HTMLThe CHtmlView class provides a view that hosts a WebBrowser control. When you use the AppWizard to create a new MFC single-document or multiple-document program, you can select CHtmlView as the base class instead of the default base class. (This option is not available to dialog-based programs).To create an MFC view based on HTML, follow these steps:
http://www.microsoft.com/visualc
You can use Navigate2 (and other methods of the WebBrowser control) to load HTML pages from other URLs, including those based on the http, https and file protocols.Make the WebBrowser Available to the Program by Using a Dialog BoxThe WebBrowser control is an ActiveX control, which means you can use familiar ActiveX techniques to embed the control into a dialog box. When you create MFC applications, make sure that you turn on support for ActiveX controls when you use the AppWizard to create the application.To make the WebBrowser control available to the program, follow these steps:
Use the WebBrowser Control in a Dialog Box
REFERENCES
For more information about the WebBrowser control and how you can reuse it in programs, see the following MSDN Web site:
Reusing the WebBrowser Control http://msdn.microsoft.com/en-us/library/aa752044(VS.85).aspx
(http://msdn.microsoft.com/en-us/library/aa752044(VS.85).aspx)
PropertiesArticle ID: 315617 - Last Review: April 21, 2006 - Revision: 2.1
| Article Translations |


Back to the top








