Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  Reusing Browser Technology

Creating an HTML Resource


Rather than distribute separate HTML files for your application's use, you can add the raw HTML to your application as a resource. You can then retrieve the HTML from your application when it is needed. ShowHTMLDialog is one example of how HTML can be used from a resource by using the res: protocol.

To add the HTML as a resource, you include a file that contains nothing but the actual HTML in your application's resource script. This file is included as an HTML type resource. The following example shows how to include a file called MyHTML.htm as an HTML resource.

HTML_RESOURCE HTML "MyHTML.htm"

In this example, "HTML_RESOURCE" is the identifier of the resource. This can be either a string or a numerical identifier. "HTML" is the resource type. Visual C++ 5.0 will interpret this as the numeric value 23 and will substitute 23 for "HTML" when the resource file is opened for editing. "MyHTML.htm" is the file that contains the HTML source that will be added. The resource compiler adds this file as is and will not attempt to interpret the contents of the file.

You can specify the HTML resource in any function that will accept a res: protocol. ShowHTMLDialog is one example of how HTML can be used from a resource by using the res: protocol. You can also use FindResource and LoadResource to obtain the HTML resource. In FindResource, specify the RT_HTML value for lpType to find an HTML resource.


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site