2 Replies Latest reply on Oct 27, 2008 7:34 AM by mkruk1913

    context sensitive help and resource id mapping

      We are having a problem associating MFC-based application with context-sensitive help. We have imported the resource.h file which looks like

      #define IDD_CONFIG_SEND 102
      #define IDD_CONFIG_SAVE 143

      into RoboHelp and mapped ids IDD_CONFIG_SAVE etc to various topics. However I'm noticing that when MFC invokes HtmlHelp it actually passes the topic id formed by HID_BASE_RESOURCE + IDD_CONFIG_SAVE so it becomes 0x20066 instead of just 0x66 and the topic is not found. What are we doing wrong?

      Also: when I press F1 on a ui item which doesn't have a topic associated with it, HtmlHelp brings up an error window "Failed to launch help". Is there a way to go to a default topic instead?

        • 1. Re: context sensitive help and resource id mapping
          RoboColum(n) Level 5
          Hi mkruk1913.

          I can't answer your first query as I am not from a development background. However it should be possible to define code the application call to say that if the F1 key is pressed and there is no mapid associated with the dialog, to open the help file at the default topic. In a previous incarnation we used a VB app and had a mapid of 0 (zero) specifically for this purpose.
          • 2. Re: context sensitive help and resource id mapping
            mkruk1913 Level 1
            My error was that I was feeding resource.h directly into RoboHelp. In fact I had to generate another .h file which is usually called HTMLDefines.h. Visual Studio creates the following script for doing it:

            echo // Generated Help Map file. Used by helptest.HHP. > "HTMLDefines.h"
            echo. > "HTMLDefines.h"
            echo // Commands (ID_* and IDM_*) >> "HTMLDefines.h"
            makehm /h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 "$(InputFileName)" >> "HTMLDefines.h"
            echo. >> "HTMLDefines.h"
            echo // Prompts (IDP_*) >> "HTMLDefines.h"
            makehm /h IDP_,HIDP_,0x30000 "$(InputFileName)" >> "HTMLDefines.h"
            echo. >> "HTMLDefines.h"
            echo // Resources (IDR_*) >> "HTMLDefines.h"
            makehm /h IDR_,HIDR_,0x20000 "$(InputFileName)" >> "HTMLDefines.h"
            echo. >> "HTMLDefines.h"
            echo // Dialogs (IDD_*) >> "HTMLDefines.h"
            makehm /h IDD_,HIDD_,0x20000 "$(InputFileName)" >> "HTMLDefines.h"
            echo. >> "HTMLDefines.h"
            echo // Frame Controls (IDW_*) >> "HTMLDefines.h"
            makehm /h /a afxhh.h IDW_,HIDW_,0x50000 "$(InputFileName)" >> "HTMLDefines.h"