The Ex29a Example: MFC and DHTML
MFC's support for DHTML starts with a new CView derivative, CHtmlView. CHtmlView allows you to embed an HTML view inside frame windows or splitter windows, and with some DHTML work it can act as a dynamic form. Example Ex29a demonstrates how to use the new CHtmlView class in a vanilla MDI application.Follow these steps to create the Ex29a example:
Run the MFC Application Wizard and create the Ex29a project. Make the project an SDI application. Accept all the other defaults, except select CHtmlView as the base class on the Generated Classes page.
Edit the URL to be loaded. In the CEx29aView::OnInitialUpdate function, you'll see this line:Navigate2(_T("http://www.msdn.microsoft.com/visualc/"),NULL,NULL);
You can edit this line to have the application load a local page or a URL other than the Visual C++ .NET page.
Compile and run the application. Figure 29-3 shows the application running with the default Web page.
Figure 29-3: The Ex29a example.