Implementation of HTML Help in MFC - Help please!!
-
Hello, I am new to this forum and new to HTML Help too. I have created a .chm file from the HTML Help Workshop. Now, i am trying to implement it in MFC program. I am stuck here with the context sensitive help where i have a "Help" button in a dialog box and should display the appropriate help provided for the dialog box. I can't understand how to create the context ids and how to pass between the HTML Help workshop file (.chm) and MFC. Any sample would be really helpful. Could anyone please help me to do this. Its quite urgent :( Thanks in advance, Regards Priya
-
Hello, I am new to this forum and new to HTML Help too. I have created a .chm file from the HTML Help Workshop. Now, i am trying to implement it in MFC program. I am stuck here with the context sensitive help where i have a "Help" button in a dialog box and should display the appropriate help provided for the dialog box. I can't understand how to create the context ids and how to pass between the HTML Help workshop file (.chm) and MFC. Any sample would be really helpful. Could anyone please help me to do this. Its quite urgent :( Thanks in advance, Regards Priya
Hi, I don't know is it possible to fetch the context IDs programmatically from the CHM-file. I have always used hardcoded values (and the people who have made the help-files have ofcourse used those same values). So, make a header file. e.g. HelpIDs.h where you define the IDs:
#define HID_MAINVIEW 100 #define HID_SOMEOTHERVIEW 101 #define HID_YETANOTHERVIEW 102
Then include this file and just invoke html help with the correct idHtmlHelp( GetDesktopWindow(), "helpfile.chm", HH_HELP_CONTEXT, HID_MAINVIEW) ;
I have no experience from making the chm-files though.. -
Hi, I don't know is it possible to fetch the context IDs programmatically from the CHM-file. I have always used hardcoded values (and the people who have made the help-files have ofcourse used those same values). So, make a header file. e.g. HelpIDs.h where you define the IDs:
#define HID_MAINVIEW 100 #define HID_SOMEOTHERVIEW 101 #define HID_YETANOTHERVIEW 102
Then include this file and just invoke html help with the correct idHtmlHelp( GetDesktopWindow(), "helpfile.chm", HH_HELP_CONTEXT, HID_MAINVIEW) ;
I have no experience from making the chm-files though..Thanks for the reply. There is a .hm file created by the project which has the following IDH_* IDH_MAINFRAME 0x20080 IDH_HTML_HTYPE 0x20081 IDH_ABOUTBOX 0x20064 and as u told, i created the HelpID.h and defined the ids. While compiling it gives the following error. error C2065: 'HID_MAINFRAME' : undeclared identifier I looked into the article in http://www.codeguru.com/Cpp/W-P/help/html/print.php/c6513/ and he has done it without using OnHelp functions but could access any topics which i couldn't understand how. Can anyone done such help projects with HTML Help? Or can anyone explain how the context ids are working? Thanks Priya
-
Thanks for the reply. There is a .hm file created by the project which has the following IDH_* IDH_MAINFRAME 0x20080 IDH_HTML_HTYPE 0x20081 IDH_ABOUTBOX 0x20064 and as u told, i created the HelpID.h and defined the ids. While compiling it gives the following error. error C2065: 'HID_MAINFRAME' : undeclared identifier I looked into the article in http://www.codeguru.com/Cpp/W-P/help/html/print.php/c6513/ and he has done it without using OnHelp functions but could access any topics which i couldn't understand how. Can anyone done such help projects with HTML Help? Or can anyone explain how the context ids are working? Thanks Priya
-
Lakshmi Priya Musuvathy wrote: error C2065: 'HID_MAINFRAME' : undeclared identifier I'd quess that you simply don't include the header file correctly or that you have a typo somewhere. Should it be IDH_MAINFRAME for example?
Hi, Yes, it was IDH_MAINFRAME and i was not giving the correct header file. it worked now. :) many thanks, Regards Priya