Share via


Opening an HTML Resource as the Default Page in a Web Browser Application

Home Page (HTML Resource)OverviewHow Do I ... Topics

Your can be a container for any Web-style content, including HTML resources that are part of your project. You use the OnInitialUpdate function of the view class to specify the content that you want initially displayed by the application.

Within OnInitialUpdate, the Navigate2 method displays an URL that uses the http: protocol. For example:

   Navigate2(_T("https://msdn.microsoft.com/visualc/"),NULL,NULL);

To display an HTML resource that is part of your project, use the LoadFromResource function instead. For example:

   LoadFromResource(IDR_MyHTMLResource);

Note   If your HTML page contains calls to bitmaps or other graphic images that are compiled as part of your project's resource script (.rc file), you must use the res: protocol to display them. The res: protocol supports displaying a resource that resides in a compiled .dll or .exe module.

What do you want to know more about?

What do you want to do?

Create a new HTML resource

Import an existing HTML file as a resource

Preview the HTML resource