![]() |
Platforms, Frameworks & Libraries »
MFC »
MFC/ATL for VC++ 7
Intermediate
CDHtmlDialog with CSS, JavaScript and imagesBy iTreeSoftAn article on how to use CSS, JavaScript and images in resource with CDHtmlDialog in VC++ .NET |
VC7, VC7.1, Windows, .NET, MFC, VS.NET2003, Dev
|
|
Advanced Search |
|
|
|
||||||||||||||||

This article shows how to use CSS, JavaScript and images in resource with
CDHtmlDialog in VC++ .NET. I build this project with VC++ 7.1(VS
.NET 2003), and it should also work with VC++ 7.0(VS .NET 2002).
CDHtmlDialog is a new class, in MFC 7.x, that enables dialog to
use HTML files as resource.
For example, if there are lines below in the raw HTML file,
<SCRIPT src="layout.js" type=text/javascript></SCRIPT> <link type="text/css" rel="stylesheet" href="classic.css" /> <img src="showit.gif">
To use CSS files, JavaScript files and images in resource, you must convert all links in HTML file to be the resource numbers.
#define IDR_CUS1 131 #define IDR_CUS2 132 #define IDR_CUS3 133
<SCRIPT src="res:/CUS/#131" type=text/javascript></SCRIPT> <link type="text/css" rel="stylesheet" href="res:/CUS/#132" /> <img src="res:/CUS/#133">
Then your HTML dialog can make use of those three files in the resource of
the executable file.
:-) Good luck.
And this is my first article on CodeProject.com.
Welcome to my page iTreeSoft.
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||