Microsoft KB Archive/241209

= How To Convert a New MFC Application to HTML Help Using WinHelp =

Article ID: 241209

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft HTML Help 1.21
 * Microsoft HTML Help 1.22

-



This article was previously published under Q241209



SUMMARY
This article describes how to convert an MFC AppWizard generated context-sensitive Help enabled application to use HTML Help instead of WinHelp. It assumes that no modifications have been made to the application since the AppWizard generated it. The result is the equivalent of the context-sensitive Help application generated by the AppWizard except that HTML Help is used instead of WinHelp. The same basic functionality will be present. It is not a complete Help system but it provides general help and context help for menu items.

The procedure is slightly different depending on whether a document/view application or a dialog-based application is generated. The differences are noted below.



MORE INFORMATION
 After you create your MFC application with the AppWizard with context-sensitive help enabled, build the project. Download the HTML Help Workshop and install it. It is available for no charge here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp

Installing the HTML Help Workshop also installs the library and header files you need to in order to implement HTML Help in your application. Run the HTML Help Workshop and select File, New, Project, then click OK. Check the Convert WinHelp Project box and click Next. Type in the path name of your WinHelp project (.hpj file) and the path name you want to use for your HTML Help project file, (.hhp). (Hint: It will make things simpler later on if you put your HTML Help file in the same folder as the WinHelp file. The rest of this article assumes you have done this.) Click Next and Finish. Save your HTML Help project and exit the HTML Help Workshop.  If you are creating a dialog-based application you can skip this step.

Using a text editor, open the HTML Help project file (.hhp), and add a blank line to the end of the file. Then insert the following block of code. [ALIAS] main_index = html\afxc0wc8.htm menu_file = html\afxc0c4l.htm menu_edit = html\afxc49x0.htm menu_view = html\afxc0853.htm menu_window = html\afxc9ctz.htm menu_help = html\afxc181c.htm hid_file_new = html\afxc72d3.htm afx_hidd_newtypedlg = html\afxc14vb.htm hid_file_open = html\afxc8rhq.htm afx_hidd_fileopen = html\afxc31ym.htm hid_file_close = html\afxc45r9.htm hid_file_save = html\afxc9y05.htm hid_file_save_as = html\afxc30hf.htm hid_file_send_mail = html\afxc0qss.htm afx_hidd_filesave = html\afxc48h1.htm hid_file_mru_file1 = html\afxc590x.htm hid_app_exit = html\afxc7d4k.htm hid_edit_undo = html\afxc8zxr.htm hid_edit_redo = html\afxc1cof.htm hid_edit_cut = html\afxc3ewk.htm hid_edit_copy = html\afxc7yt5.htm hid_edit_paste = html\afxc67ad.htm hid_view_toolbar = html\afxc8ble.htm afx_hidw_toolbar = html\afxc9jci.htm hid_view_status_bar = html\afxc6tv6.htm afx_hidw_status_bar = html\afxc72ya.htm hid_window_new = html\afxc0xpz.htm hid_window_cascade = html\afxc9u5h.htm hid_window_tile = html\afxc3zz9.htm hid_window_tile_horz = html\afxc3at6.htm hid_window_tile_vert = html\afxc1304.htm hid_window_arrange = html\afxc4mn9.htm hid_window_split = html\afxc5ph0.htm hid_window_all = html\afxc9sz0.htm hid_help_index = html\afxc85dk.htm hid_help_using = html\afxc1tk7.htm hid_app_about = html\afxc9vp0.htm hid_context_help = html\afxc9ysw.htm hid_ht_caption = html\afxc4r72.htm scrollbars = html\afxc1g4z.htm hid_sc_size = html\afxc8eed.htm hid_sc_move = html\afxc57j9.htm hid_sc_minimize = html\afxc1vqd.htm hid_sc_maximize = html\afxc6ztx.htm hid_sc_nextwindow = html\afxc33uf.htm hid_sc_prevwindow = html\afxc6t2v.htm hid_sc_close = html\afxc0085.htm hid_sc_restore = html\afxc5tr9.htm hid_sc_tasklist = html\afxc1sj8.htm hid_view_ruler = html\afxc71o2.htm afx_hidd_font = html\afxc369g.htm afx_hidd_color = html\afxc465u.htm hid_edit_find = html\afxc4ajo.htm afx_hidd_find = html\afxc2nac.htm hid_edit_replace = html\afxc121x.htm afx_hidd_replace = html\afxc8asl.htm hid_edit_repeat = html\afxc56lw.htm hid_edit_clear = html\afxc214i.htm hid_edit_clear_all = html\afxc2fsc.htm hid_next_pane = html\afxc0l7p.htm hid_prev_pane = html\afxc48o5.htm hidr_convertype = html\afxc31id.htm hidr_doc1type = html\afxc31id.htm hid_ht_nowhere = html\afxc5zol.htm afx_hidp_default = html\afxc9b3o.htm hid_file_print = html\afxp225w.htm afx_hidd_print = html\afxp5hf8.htm afx_hidd_printdlg = html\afxp86av.htm hid_file_print_preview = html\afxp7q2f.htm afx_hidw_preview_bar = html\afxp3i9e.htm hid_file_print_setup = html\afxp0434.htm afx_hidd_printsetup = html\afxp0vjk.htm hid_file_page_setup = html\afxp42b4.htm

[MAP] </li> Change the include files in the [MAP] section to have .h file extensions instead of .hm file extensions.</li>  When using WinHelp, context help IDs are automatically generated when the .hlp file is generated. They are kept in a file called [yourprojectname].hm. You cannot include .hm files in an HTML Help project file. The HTML Help compiler expects include files to contain #define statements. You need to manually edit the file, hlp\[yourprojectname].hm, to have #define statements following the instructions below. Then rename the file to give it a .h file extension instead of a .hm file extension.
 * 1) include <c:\Program Files\Microsoft Visual Studio\VC98\MFC\include\afxhelp.hm>
 * 2) include [yourprojectname.hm]

Use a text editor to open the file and edit it so that each line containing a context help ID is preceded by a #define statement. For example: HIDD_ABOUTBOX 0x20064 becomes: Save the file as [yourprojectname].h in the \hlp folder of your project. </li>  If you are creating a dialog-based application you can skip this step.
 * 1) define HIDD_ABOUTBOX 0x20064

Also notice that the file C:\Program Files\Microsoft Visual Studio\VC98\MFC\include\afxhelp.hm is listed in the HTML Help project file. You can create this file by using a text editor to open a new file, cut and then paste the text below into it. Name the file Afxhelp.h and copy it to the C:\Program Files\Microsoft Visual Studio\VC98\MFC\include\ folder. </li>  Using a text editor, open a new file and copy the appropriate text below to it:
 * 1) define HID_HT_NOWHERE                         0x40000
 * 2) define HID_HT_CAPTION                         0x40002
 * 3) define HID_HT_SIZE                            0x40004
 * 4) define HID_HT_HSCROLL                         0x40006
 * 5) define HID_HT_VSCROLL                         0x40007
 * 6) define HID_HT_MINBUTTON                       0x40008
 * 7) define HID_HT_MAXBUTTON                       0x40009
 * 8) define HID_HT_SIZE                            0x4000A
 * 9) define HID_HT_SIZE                            0x4000B
 * 10) define HID_HT_SIZE                            0x4000C
 * 11) define HID_HT_SIZE                            0x4000D
 * 12) define HID_HT_SIZE                            0x4000E
 * 13) define HID_HT_SIZE                            0x4000F
 * 14) define HID_HT_SIZE                            0x40010
 * 15) define HID_HT_SIZE                            0x40011
 * 16) define HID_HT_SIZE                            0x40012
 * 17) define HID_HT_OBJECT          0x40013
 * 18) define HID_HT_CLOSE           0x40014
 * 19) define HID_HT_HELP        0x40015
 * 20) define HID_SC_SIZE                            0x1EF00
 * 21) define HID_SC_MOVE                            0x1EF01
 * 22) define HID_SC_MINIMIZE                        0x1EF02
 * 23) define HID_SC_MAXIMIZE                        0x1EF03
 * 24) define HID_SC_NEXTWINDOW                      0x1EF04
 * 25) define HID_SC_PREVWINDOW                      0x1EF05
 * 26) define HID_SC_CLOSE                           0x1EF06
 * 27) define HID_SC_RESTORE                         0x1EF12
 * 28) define HID_SC_TASKLIST                        0x1EF13
 * 29) define HID_FILE_MRU_FILE1                     0x1E110
 * 30) define HID_FILE_MRU_FILE1                     0x1E111
 * 31) define HID_FILE_MRU_FILE1                     0x1E112
 * 32) define HID_FILE_MRU_FILE1                     0x1E113
 * 33) define HID_FILE_MRU_FILE1                     0x1E114
 * 34) define HID_FILE_MRU_FILE1                     0x1E115
 * 35) define HID_FILE_MRU_FILE1                     0x1E116
 * 36) define HID_FILE_MRU_FILE1                     0x1E117
 * 37) define HID_FILE_MRU_FILE1                     0x1E118
 * 38) define HID_FILE_MRU_FILE1                     0x1E119
 * 39) define HID_FILE_MRU_FILE1                     0x1E11A
 * 40) define HID_FILE_MRU_FILE1                     0x1E11B
 * 41) define HID_FILE_MRU_FILE1                     0x1E11C
 * 42) define HID_FILE_MRU_FILE1                     0x1E11D
 * 43) define HID_FILE_MRU_FILE1                     0x1E11E
 * 44) define HID_FILE_MRU_FILE1                     0x1E11F
 * 45) define HID_WINDOW_ALL                         0x1EF1F
 * 46) define HID_OLE_VERB_1                         0x1E210
 * 47) define HID_OLE_VERB_1                         0x1E211
 * 48) define HID_OLE_VERB_1                         0x1E212
 * 49) define HID_OLE_VERB_1                         0x1E213
 * 50) define HID_OLE_VERB_1                         0x1E214
 * 51) define HID_OLE_VERB_1                         0x1E215
 * 52) define HID_OLE_VERB_1                         0x1E216
 * 53) define HID_OLE_VERB_1                         0x1E217
 * 54) define HID_OLE_VERB_1                         0x1E218
 * 55) define HID_OLE_VERB_1                         0x1E219
 * 56) define HID_OLE_VERB_1                         0x1E21A
 * 57) define HID_OLE_VERB_1                         0x1E21B
 * 58) define HID_OLE_VERB_1                         0x1E21C
 * 59) define HID_OLE_VERB_1                         0x1E21D
 * 60) define HID_OLE_VERB_1                         0x1E21E
 * 61) define HID_OLE_VERB_1                         0x1E21F
 * 62) define HID_FILE_NEW                           0x1E100
 * 63) define HID_FILE_OPEN                          0x1E101
 * 64) define HID_FILE_CLOSE                         0x1E102
 * 65) define HID_FILE_SAVE                          0x1E103
 * 66) define HID_FILE_SAVE_AS                       0x1E104
 * 67) define HID_FILE_PAGE_SETUP                    0x1E105
 * 68) define HID_FILE_PRINT_SETUP                   0x1E106
 * 69) define HID_FILE_PRINT                         0x1E107
 * 70) define HID_FILE_PRINT_DIRECT                  0x1E108
 * 71) define HID_FILE_PRINT_PREVIEW                 0x1E109
 * 72) define HID_FILE_UPDATE                        0x1E10A
 * 73) define HID_FILE_SAVE_COPY_AS                  0x1E10B
 * 74) define HID_FILE_SEND_MAIL                     0x1E10C
 * 75) define HID_EDIT_CLEAR                         0x1E120
 * 76) define HID_EDIT_CLEAR_ALL                     0x1E121
 * 77) define HID_EDIT_COPY                          0x1E122
 * 78) define HID_EDIT_CUT                           0x1E123
 * 79) define HID_EDIT_FIND                          0x1E124
 * 80) define HID_EDIT_PASTE                         0x1E125
 * 81) define HID_EDIT_PASTE_LINK                    0x1E126
 * 82) define HID_EDIT_PASTE_SPECIAL                 0x1E127
 * 83) define HID_EDIT_REPEAT                        0x1E128
 * 84) define HID_EDIT_REPLACE                       0x1E129
 * 85) define HID_EDIT_SELECT_ALL                    0x1E12A
 * 86) define HID_EDIT_UNDO                          0x1E12B
 * 87) define HID_EDIT_REDO                          0x1E12C
 * 88) define HID_WINDOW_NEW                         0x1E130
 * 89) define HID_WINDOW_ARRANGE                     0x1E131
 * 90) define HID_WINDOW_CASCADE                     0x1E132
 * 91) define HID_WINDOW_TILE_HORZ                   0x1E133
 * 92) define HID_WINDOW_TILE_VERT                   0x1E134
 * 93) define HID_WINDOW_SPLIT                       0x1E135
 * 94) define HID_APP_ABOUT                          0x1E140
 * 95) define HID_APP_EXIT                           0x1E141
 * 96) define HID_HELP_INDEX                         0x1E142
 * 97) define HID_HELP_FINDER                        0x1E143
 * 98) define HID_HELP_USING                         0x1E144
 * 99) define HID_CONTEXT_HELP                       0x1E145
 * 100) define HID_NEXT_PANE                          0x1E150
 * 101) define HID_PREV_PANE                          0x1E151
 * 102) define HID_FORMAT_FONT                        0x1E160
 * 103) define HID_OLE_INSERT_NEW                     0x1E200
 * 104) define HID_OLE_EDIT_LINKS                     0x1E201
 * 105) define HID_OLE_EDIT_CONVERT                   0x1E202
 * 106) define HID_OLE_EDIT_CHANGE_ICON               0x1E203
 * 107) define HID_OLE_EDIT_PROPERTIES                0x1E204
 * 108) define HID_VIEW_TOOLBAR                       0x1E800
 * 109) define HID_VIEW_STATUS_BAR                    0x1E801
 * 110) define HID_RECORD_FIRST                       0x1E900
 * 111) define HID_RECORD_LAST                        0x1E901
 * 112) define HID_RECORD_NEXT                        0x1E902
 * 113) define HID_RECORD_PREV                        0x1E903
 * 114) define HID_WIZBACK                            0x13023
 * 115) define HID_WIZNEXT                            0x13024
 * 116) define HID_WIZFINISH                          0x13025
 * 117) define AFX_HIDD_FILEOPEN                      0x27004
 * 118) define AFX_HIDD_FILESAVE                      0x27005
 * 119) define AFX_HIDD_FONT                          0x27006
 * 120) define AFX_HIDD_COLOR                         0x27007
 * 121) define AFX_HIDD_PRINT                         0x27008
 * 122) define AFX_HIDD_PRINTSETUP                    0x27009
 * 123) define AFX_HIDD_FIND                          0x2700A
 * 124) define AFX_HIDD_REPLACE                       0x2700B
 * 125) define AFX_HIDD_NEWTYPEDLG                    0x27801
 * 126) define AFX_HIDD_PRINTDLG                      0x27802
 * 127) define AFX_HIDD_PREVIEW_TOOLBAR               0x27803
 * 128) define AFX_HIDD_PREVIEW_SHORTTOOLBAR          0x2780B
 * 129) define AFX_HIDD_INSERTOBJECT                  0x27804
 * 130) define AFX_HIDD_CHANGEICON                    0x27805
 * 131) define AFX_HIDD_CONVERT                       0x27806
 * 132) define AFX_HIDD_PASTESPECIAL                  0x27807
 * 133) define AFX_HIDD_EDITLINKS                     0x27808
 * 134) define AFX_HIDD_FILEBROWSE                    0x27809
 * 135) define AFX_HIDD_BUSY                          0x2780A
 * 136) define AFX_HIDD_OBJECTPROPERTIES              0x2780C
 * 137) define AFX_HIDD_CHANGESOURCE                  0x2780D
 * 138) define AFX_HIDP_NO_ERROR_AVAILABLE            0x3F020
 * 139) define AFX_HIDP_INVALID_FILENAME              0x3F100
 * 140) define AFX_HIDP_FAILED_TO_OPEN_DOC            0x3F101
 * 141) define AFX_HIDP_FAILED_TO_SAVE_DOC            0x3F102
 * 142) define AFX_HIDP_ASK_TO_SAVE                   0x3F103
 * 143) define AFX_HIDP_FAILED_TO_CREATE_DOC          0x3F104
 * 144) define AFX_HIDP_FILE_TOO_LARGE                0x3F105
 * 145) define AFX_HIDP_FAILED_TO_START_PRINT         0x3F106
 * 146) define AFX_HIDP_FAILED_TO_LAUNCH_HELP         0x3F107
 * 147) define AFX_HIDP_INTERNAL_FAILURE              0x3F108
 * 148) define AFX_HIDP_COMMAND_FAILURE               0x3F109
 * 149) define AFX_HIDP_FAILED_MEMORY_ALLOC           0x3F10A
 * 150) define AFX_HIDP_UNREG_DONE                    0x3F10B
 * 151) define AFX_HIDP_UNREG_FAILURE                 0x3F10C
 * 152) define AFX_HIDP_DLL_LOAD_FAILED               0x3F10D
 * 153) define AFX_HIDP_DLL_BAD_VERSION               0x3F10E
 * 154) define AFX_HIDP_PARSE_INT                     0x3F110
 * 155) define AFX_HIDP_PARSE_REAL                    0x3F111
 * 156) define AFX_HIDP_PARSE_INT_RANGE               0x3F112
 * 157) define AFX_HIDP_PARSE_REAL_RANGE              0x3F113
 * 158) define FX_HIDP_PARSE_STRING_SIZE             0x3F114
 * 159) define AFX_HIDP_PARSE_RADIO_BUTTON            0x3F115
 * 160) define AFX_HIDP_PARSE_BYTE                    0x3F116
 * 161) define AFX_HIDP_PARSE_UINT                    0x3F117
 * 162) define AFX_HIDP_PARSE_DATETIME                0x3F118
 * 163) define AFX_HIDP_PARSE_CURRENCY                0x3F119
 * 164) define AFX_HIDP_FAILED_INVALID_FORMAT         0x3F120
 * 165) define AFX_HIDP_FAILED_INVALID_PATH           0x3F121
 * 166) define AFX_HIDP_FAILED_DISK_FULL              0x3F122
 * 167) define AFX_HIDP_FAILED_ACCESS_READ            0x3F123
 * 168) define AFX_HIDP_FAILED_ACCESS_WRITE           0x3F124
 * 169) define AFX_HIDP_FAILED_IO_ERROR_READ          0x3F125
 * 170) define AFX_HIDP_FAILED_IO_ERROR_WRITE         0x3F126
 * 171) define AFX_HIDP_STATIC_OBJECT                 0x3F180
 * 172) define AFX_HIDP_FAILED_TO_CONNECT             0x3F181
 * 173) define AFX_HIDP_SERVER_BUSY                   0x3F182
 * 174) define AFX_HIDP_BAD_VERB                      0x3F183
 * 175) define AFX_HIDP_FAILED_TO_NOTIFY              0x3F185
 * 176) define AFX_HIDP_FAILED_TO_LAUNCH              0x3F186
 * 177) define AFX_HIDP_ASK_TO_UPDATE                 0x3F187
 * 178) define AFX_HIDP_FAILED_TO_UPDATE              0x3F188
 * 179) define AFX_HIDP_FAILED_TO_REGISTER            0x3F189
 * 180) define AFX_HIDP_FAILED_TO_AUTO_REGISTER       0x3F18A
 * 181) define AFX_HIDP_FAILED_TO_CONVERT             0x3F18B
 * 182) define AFX_HIDP_GET_NOT_SUPPORTED             0x3F18C
 * 183) define AFX_HIDP_SET_NOT_SUPPORTED             0x3F18D
 * 184) define AFX_HIDP_ASK_TO_DISCARD                0x3F18E
 * 185) define AFX_HIDP_FAILED_TO_CREATE              0x3F18F
 * 186) define AFX_HIDP_FAILED_MAPI_LOAD              0x3F190
 * 187) define AFX_HIDP_INVALID_MAPI_DLL              0x3F191
 * 188) define AFX_HIDP_FAILED_MAPI_SEND              0x3F192
 * 189) define AFX_HIDP_FILE_NONE                     0x3F1A0
 * 190) define AFX_HIDP_FILE_GENERIC                  0x3F1A1
 * 191) define AFX_HIDP_FILE_NOT_FOUND                0x3F1A2
 * 192) define AFX_HIDP_FILE_BAD_PATH                 0x3F1A3
 * 193) define AFX_HIDP_FILE_TOO_MANY_OPEN            0x3F1A4
 * 194) define AFX_HIDP_FILE_ACCESS_DENIED            0x3F1A5
 * 195) define AFX_HIDP_FILE_INVALID_FILE             0x3F1A6
 * 196) define AFX_HIDP_FILE_REMOVE_CURRENT           0x3F1A7
 * 197) define AFX_HIDP_FILE_DIR_FULL                 0x3F1A8
 * 198) define AFX_HIDP_FILE_BAD_SEEK                 0x3F1A9
 * 199) define AFX_HIDP_FILE_HARD_IO                  0x3F1AA
 * 200) define AFX_HIDP_FILE_SHARING                  0x3F1AB
 * 201) define AFX_HIDP_FILE_LOCKING                  0x3F1AC
 * 202) define AFX_HIDP_FILE_DISKFULL                 0x3F1AD
 * 203) define AFX_HIDP_FILE_EOF                      0x3F1AE
 * 204) define AFX_HIDP_ARCH_NONE                     0x3F1B0
 * 205) define AFX_HIDP_ARCH_GENERIC                  0x3F1B1
 * 206) define AFX_HIDP_ARCH_READONLY                 0x3F1B2
 * 207) define AFX_HIDP_ARCH_ENDOFFILE                0x3F1B3
 * 208) define AFX_HIDP_ARCH_WRITEONLY                0x3F1B4
 * 209) define AFX_HIDP_ARCH_BADINDEX                 0x3F1B5
 * 210) define AFX_HIDP_ARCH_BADCLASS                 0x3F1B6
 * 211) define AFX_HIDP_ARCH_BADSCHEMA                0x3F1B7
 * 212) define AFX_HIDP_SQL_CONNECT_FAIL              0x3F281
 * 213) define AFX_HIDP_SQL_RECORDSET_FORWARD_ONLY    0x3F282
 * 214) define AFX_HIDP_SQL_EMPTY_COLUMN_LIST         0x3F283
 * 215) define AFX_HIDP_SQL_FIELD_SCHEMA_MISMATCH     0x3F284
 * 216) define AFX_HIDP_SQL_ILLEGAL_MODE              0x3F285
 * 217) define AFX_HIDP_SQL_MULTIPLE_ROWS_AFFECTED    0x3F286
 * 218) define AFX_HIDP_SQL_NO_CURRENT_RECORD         0x3F287
 * 219) define AFX_HIDP_SQL_NO_ROWS_AFFECTED          0x3F288
 * 220) define AFX_HIDP_SQL_RECORDSET_READONLY        0x3F289
 * 221) define AFX_HIDP_SQL_SQL_NO_TOTAL              0x3F28A
 * 222) define AFX_HIDP_SQL_ODBC_LOAD_FAILED          0x3F28B
 * 223) define AFX_HIDP_SQL_DYNASET_NOT_SUPPORTED     0x3F28C
 * 224) define AFX_HIDP_SQL_SNAPSHOT_NOT_SUPPORTED    0x3F28D
 * 225) define AFX_HIDP_SQL_API_CONFORMANCE           0x3F28E
 * 226) define AFX_HIDP_SQL_SQL_CONFORMANCE           0x3F28F
 * 227) define AFX_HIDP_SQL_NO_DATA_FOUND             0x3F290
 * 228) define AFX_HIDP_SQL_ROW_UPDATE_NOT_SUPPORTED  0x3F291
 * 229) define AFX_HIDP_SQL_ODBC_V2_REQUIRED          0x3F292
 * 230) define AFX_HIDP_SQL_NO_POSITIONED_UPDATES     0x3F293
 * 231) define AFX_HIDP_SQL_LOCK_MODE_NOT_SUPPORTED   0x3F294
 * 232) define AFX_HIDP_SQL_DATA_TRUNCATED            0x3F295
 * 233) define AFX_HIDP_SQL_ROW_FETCH                 0x3F296
 * 234) define AFX_HIDP_SQL_INCORRECT_ODBC            0x3F297
 * 235) define AFX_HIDP_SQL_UPDATE_DELETE_FAILED      0x3F298
 * 236) define AFX_HIDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED  0x3F299
 * 237) define AFX_HIDP_SQL_FIELD_NOT_FOUND           0x3F29A
 * 238) define AFX_HIDP_SQL_BOOKMARKS_NOT_SUPPORTED   0x3F29B
 * 239) define AFX_HIDP_SQL_BOOKMARKS_NOT_ENABLED     0x3F29C
 * 240) define AFX_HIDP_DAO_ENGINE_INITIALIZATION     0x3F2B0
 * 241) define AFX_HIDP_DAO_DFX_BIND                  0x3F2B1
 * 242) define AFX_HIDP_DAO_OBJECT_NOT_OPEN           0x3F2B2
 * 243) define AFX_HIDP_DAO_ROWTOOSHORT               0x3F2B3
 * 244) define AFX_HIDP_DAO_BADBINDINFO               0x3F2B4
 * 245) define AFX_HIDP_DAO_COLUMNUNAVAILABLE         0x3F2B5
 * 246) define AFX_HIDW_TOOLBAR                       0x5E800
 * 247) define AFX_HIDW_STATUS_BAR                    0x5E801
 * 248) define AFX_HIDW_PREVIEW_BAR                   0x5E802
 * 249) define AFX_HIDW_RESIZE_BAR                    0x5E803
 * 250) define AFX_HIDW_DOCKBAR_TOP                   0x5E81B
 * 251) define AFX_HIDW_DOCKBAR_LEFT                  0x5E81C
 * 252) define AFX_HIDW_DOCKBAR_RIGHT                 0x5E81D
 * 253) define AFX_HIDW_DOCKBAR_BOTTOM                0x5E81E
 * 254) define AFX_HIDW_DOCKBAR_FLOAT                 0x5E81F

Dialog-based Application

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML> <HEAD> <meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">

</HEAD><BODY> <OBJECT type="text/site properties"> <param name="ImageType" value="Folder"> </OBJECT> <UL> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="<<add your application-specific topics here>>"> </OBJECT> <UL> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="<<add your topic jumps here>>"> <param name="Local" value="html\afxd3hnr.htm"> </OBJECT> </UL> </UL> </BODY></HTML>

SDI/MDI Application <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML> <HEAD> <meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">

</HEAD><BODY> <OBJECT type="text/site properties"> <param name="ImageType" value="Folder"> </OBJECT> <UL> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="Menus"> </OBJECT> <UL> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="File menu"> <param name="Local" value="html\afxc0c4l.htm"> </OBJECT> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="Edit menu"> <param name="Local" value="html\afxc49x0.htm"> </OBJECT> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="View Menu"> <param name="Local" value="html\afxc0853.htm"> </OBJECT> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="Window menu"> <param name="Local" value="html\afxc9ctz.htm"> </OBJECT> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="Help menu"> <param name="Local" value="html\afxc181c.htm"> </OBJECT> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="<<add your application-specific topics here>>"> </OBJECT> <UL> <LI> <OBJECT type="text/sitemap"> <param name="Name" value="<<add your topic jumps here>>"> <param name="Local" value="html\afxc0wc8.htm"> </OBJECT> </UL> </UL> </UL> </BODY></HTML> Save the file and name it Table of Contents.hhc. Put it in the same folder as your .hhp file. </li> Open your .hhp file with the HTML Help Workshop and double-click the [OPTIONS] tag. Click on the Files tab and add Table of Contents.hhc to the contents file. Click OK.

NOTE: If you have created a dialog-based application, by default Visual C++ does not create an index file for your WinHelp project so there is not an index file available for conversion when you choose to convert your WinHelp project to HTML Help. Although there is no index file, the wizard still specifies an index on the Project Options File tab that you should remove so that your HTML Help project doesn't generate an error at compile time.</li> Save the .hhp file and compile it.</li> To test the HTML Help file, using File Explorer, double-click the .chm file. This displays your HTML Help project. Click on various topics to be sure that the conversion completed properly.</li> In Visual Studio, on the Files View tab, remove the .hpj, .cnt and .hlp files. This action removes the steps that build the WinHelp project.</li> Add the HTML Help project file, .hhp, to your Visual C++ project. In Visual Studio, from the Project menu select Add to Project to select and add the file to the project. Next, select the file under the Files View tab and drag it to the Help Files branch of the tree.</li> Having your HTML Help project automatically rebuilt when you rebuild your Visual C++ application is optional. To do this, right-click the .hhp file in the Files View tab, and select Settings. Add the following custom build commands in the Command field:

hhc.exe .\hlp\$(InputName).hhp

Add the following to the Outputs field:

$(InputName).chm

Make sure you add the path of hhc.exe file under the Tools menu, select Options then select Directories for Executables.</li> Include Htmlhelp.h in your CWinApp module using an include statement.</li> In Visual Studio under the Project menu choose Settings then selectLink and under Category, select General. Add Jtmlhelp.lib to the Object/library modules: selection. This causes the HTML Help library to link to your project.</li> In Visual Studio under the Tools menu choose Options then Directories, and add the path to both the Htmlhelp.lib and Htmlhelp.h files. The location of these files depends upon where the HTML Help Workshop was installed, however this file might be found at ..\Program Files\HTML Help Workshop\lib" and "\Program Files\HTML Help Workshop\include.</li>  If you are creating a dialog-based application, skip to the next step.

If you are creating an SDI/MDI application, use class wizard to add a handler for WinHelp to your CWinApp class.

Comment out the call to WinHelp in CWinApp::WinHelp.

Copy the text below into the WinHelp method. Change [yourprojectname] to the name of your .chm file. Rebuild the Visual C++ application and run it. void CTestApp::WinHelp(DWORD dwData, UINT nCmd) {       //CWinApp::WinHelp(dwData, nCmd); switch (nCmd) {       case HELP_CONTEXT: HtmlHelp(NULL, ".\\hlp\\[yourprojectname].chm",HH_HELP_CONTEXT, dwData ); break; case HELP_FINDER: HtmlHelp(NULL, ".\\hlp\\[yourprojectname].chm",HH_DISPLAY_TOPIC, 0); break; } }

</li>  If you are creating a dialog-based application, use the class wizard to add an OnHelp handler to your dialog class. This handler is invoked when the default Help button on the dialog is clicked. void CMyDlg::OnHelp {       HtmlHelp(NULL," .\\hlp\\[yourprojectname].chm",HH_DISPLAY_TOPIC, 0);

}                       </li> Rebuild the Visual C++ application and run it.</li></ol>

Keywords: kbhowto kbapi kbide KB241209

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.