IPF Editor 2.x Adding Help to C
or C++ Applications Q&A
What is needed to create help?
In order to set up to create help you will need the
following files:
A subdirectory to hold the IPF files and tables created. We recommend against doing this in your primary application development directory.
Your applications resource files (.RC) and dialog (.DLG) files
All of the include files for your application placed in the same directory as the resource and dialog files unless they are enclosed in the (meaning they are in the INCLUDE path).
If you have include files using the set the IPFEDIT_INCLUDE statement in your CONFIG.SYS to point to the appropriate directory containing your include files.
Is the Help resource file
necessary?
No. The help resource file generated during the
"Create help resource tables" process need only be used for compatibility with
help projects created with the IPF Editor 1.0x. The help tables are now created
in the C source file generated.
If you are using C++ you may find it
easier to use the help resource tables, however. Simply rcinclude the help
resource file into your primary resource file. For more information on C++
support see Appendix 1 in the IPF Editor 2.x User's Guide.
What tools are needed to add help to applications
You will need the following tools:
IPF Editor 2.x
IBM C Set/2, C Set/++, Visual Age C++ (or compatible)
IBM OS/2 Toolkit (2.11 or Warp) (specifically the resource compiler)
How do I add help for new features in my application?
If you add new features (such as new dialog box items or new
menu items), after you have already created help for your application, you have
two choices as to how to create help for them:
First, you can simply
create a new panel using the Panel List (with your already defined panels
loaded) and then on the Panel Settings Notebook's "Options" page use the "Select
ID" push button. Then select the #define label in the list provided that matches
the dialog control or menu item you want to define help for. Then save and
compile your help file when you are finished adding help. The final step
requires you to rebuild the resource tables by using the "Application, Create
help resource tables" menu item.
The second method is to use the
"Application, Generate panels from RC file" menu item. It will ask you if you
want to append these panels to the end of the current panel list. Answer "Yes".
Then reselect your primary RC file and any new panels detected will be appended
to the end of the Panel List. Once again save and compile your help document.
Then run the "Application, Create help resource tables" menu item to rebuild the
help resource tables.
You must, of course, rebuild your application
after building the help resource tables or the changes will not take effect.
How to I create separate HLP files for each DLL?
Treat each DLL as if it was a separate program. This means that
you will need to generate panels for each DLL's resource file, create help
resource tables, and compile and link them into the DLL.
There is also
one additional step which is required&colon. You must initialize the help
access as shown in the following example:
case WM_INITDLG:
HelpInit( hwnd );
HelpInstallMessageHandler( hwnd );
return (MRESULT) 0L;
case WM_HELP:
return HelpDlgDllHelp( hwnd, msg, mp1, mp2 );