 |
Add files "HTML_Dialog.cpp" and "HTML_Dialog.h"
to your project
|
 |
Under "Project Settings" and the "Link" tab,
type "htmlview.lib" (including quotes) on the
"Object/Library Modules" line
|
 |
Add #include "HTML_Dialog.h" to the
dialog or view .cpp file that will launch the html dialog window.
|
 |
Add a new dialog resource and rename it to: IDD_HTML_DIALOG.
Delete the "OK" and "Cancel" buttons.
|
 |
Create a new HTML resource and rename it to: IDR_TestPage_HTML.
Create an HTML web page in your favorite editor and copy the text
into this resource.
|
 |
If your HTML file contains pictures, add them as "GIF"
resources: "Import" the picture into the resources
and give it the type "GIF" (including the
quotes).
|
 |
Add a new menubar and call it IDR_HTML_MENUBAR1.
Add one item and give it the caption Tools. Add
two sub-items to Tools with IDs ID_FORCEFIT and ID_EDIT_COPY
and captions Force Fit and Copy,
respectively.
|
 |
Add the following code to launch the HTML dialog in response to,
e.g., a button push on another dialog:
void CRayTestHTMLDlg::OnButton1()
{//show the HTML dialog
HTML_Dialog* pDlg=new HTML_Dialog; //create
the dialog
pDlg->m_resID=IDR_TestPage_HTML; //tell
the dialog where the HTML text is located in resources
pDlg->RegisterHtmlImage(IDR_GIF1,_T("rays_rpn8.png"));
//tell the dialog where images are located in
resources
pDlg->DoModal(); //show
the window
}
You will need to modify the pDlg->RegisterHtmlImage(IDR_GIF1,_T("rays_rpn8.png"));
line to reflect the name of the image in your HTML document.
|
 |
Notes:
You can also use other types of images, but .png are usually the
most compressed.
The emulator may want to locate a bunch of ".dll"
files to help with debugging but just close those windows.
|