Creating a New HTML Resource

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

In Visual C++, you create a new HTML resource just as you would any other Windows resource. You can also import an existing HTML file into your project's resource script.

To create an HTML resource

  1. From the Insert menu, choose Resource.

  2. In the Resource Type list, select HTML, then click New.

    Visual C++ creates a new HTML resource, giving it a unique ID, such as IDR_HTML1.

You can take advantage of the Text editor's HTML syntax highlighting, and all other Text editor operations as you code your HTML page. Because the HTML page is part of your project's resource script (.rc file), typical file operations such as saving or closing apply to the entire resource file, not just the HTML page you are editing.

Note   If your HTML page contains calls to bitmaps or other graphic images, you may want to include the corresponding image files in your resource script to ensure their availability when the user runs the application. If you do so, then use the to display these graphic images from your page. The res: protocol supports displaying a resource that resides in a compiled .dll or .exe module.

What do you want to do?

Import an existing HTML file as a resource

Preview the HTML resource

Set syntax coloring for a custom HTML variation