6 Replies Latest reply on Nov 26, 2007 8:56 AM by Peter Grainge

    Converting from Winhelp to HTMLHelp Part 2

      Converting an existing application from Winhelp to HTMLHelp
      PART II

      9. Then had to figure out how to get the compiler to create the #define statements for the project.
      a. Created a new Microsoft MFC project in Visual Studio called HTMLTEST.
      b. Discovered that the resource.h file had a Custom Built Step! (I didn’t know that .h files could be “compiled”!!! Sort of a disgusting concept!)
      c. Lifted the following from the Custom Build Step for Resource.h in HTMLTEST and copied it to a custom build step for my application:

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

      10. Had to make sure HTMLDefines.h was added to the Robohelp Map Files area by using “Import Map f\File…” (Also BSSCDefault.h needs to be there but I still don’t know why. I still don’t know where it came from…)
      11. So then I had to figure out how to get Visual Studio to compile the help file. I added the following to the .hhp’s Custom Build Step - Command Line:

      hhc "htmlhelp\HandyAvi.hhp" > htmlhelp\handyaviHELPERRORS.txt"
      Echo Compile finished.
      Echo There is a log file: "file://c:\MyProjects\HandyAvi\HandyAvi\htmlhelp\handyaviHELPERRORS.txt"
      Echo Check on result.
      if not exist "htmlhelp\HandyAvi.chm" goto :HelpError
      copy "htmlhelp\HandyAvi.chm" "$(OutDir)"
      goto :HelpDone
      echo hlp\$(ProjectName).hhp : error: Problem encountered creating help file
      goto :HelpDone
      echo hlp\$(ProjectName).hhp : error: HHC failed during help file creation.

      I added the handyaviHELPERRORS.txt file to capture the output of the hhc compiler. It is accessible easily from within Visual Studio using a Ctrl-Left-mouse-click similar to other things in the Microsoft Visual Studio Output window.

      12. Anyway, that restored my compiler behavior to what it used to be when I was using WinHelp. It now compiles the help file when necessary.
      13. Then I discovered that the .css files created during the conversion from Word to HTML did not contain correct size for the Headers H1, H2, H3. Hand-edited each one (they are just text files) to change the header sizes.
      14. That worked and all headers are now displayed properly.

      1. Robohelp for Word, after compile, cannot bring up the result. It fails with an mk:@MSITStore… error. (I don’t need that now but it is irksome…)
      a. The robohelp people WERE able to replicate this on their machine using my help directory.
      b. They didn’t know what was causing it.
      c. My experiments revealed that if I eliminated all of my image files from the project, the problem did not occur.
      d. I could use 10 or 20 images and it would work.
      e. When I added all the images, the problem then occurred again.
      f. I resized all images to make sure they were of width 590 pixels or less but the problem still occurred.
      g. No solution. Irritating…
      2. Help – Contents and Index brings up some strange semi-on-line page.
      a. Search using that page says “LiveDocs Search Results – your search for map site: http://help.adobe.com/en_US/Robohelp/RHTML/7.0 did not match any documents…
      b. I would rather it bring up the local document! I discovered the local document, "C:\Program Files\Adobe\Adobe RoboHelp 7\RoboHTML\Robohtml.chm", only recently by looking through the Robohelp directory and guessing that this might be the help document.
      3. Context Sensitive Help
      a. Edit Map IDs is probably one of the most obtuse user interfaces I have ever seen.
      b. Was not clear what was assigned to what or what that did.
      c. Little yellow and blue boxes with question marks didn’t help much.
      d. Was not clear how map #s were initially assigned. Finally figured out that they are assigned by the resource.h file’s custom build step in Visual Studio.
      e. The help button provides some information but it doesn’t say WHAT the panel is actually accomplishing, i.e., why “assign” anything. I know now but I didn’t know when I first tried to use it.
      f. Why is there a question mark on the blue icon? That usually means that something is screwed up and “questionable”! At least that is what it conveys to me…
      4. I don’t need it now but I still don’t see how to command-line compile the help file that Robohelp for Word’s seems to be able to compile.
      5. Fortunately, I figured out how to command-line compile the “Robohelp HTML” stuff.