Feedback Search Top Backward Forward

Questions and Answers

Written by Larry Salomon, Jr.


Carsten Haerle ( writes:

I have a simple but interesting question concerning the help menu in PM applications. I searched for hours and days but I didn't find the answer to it. Even all the documentation in the toolkit, the developers connection and the DAP library volume didn't give me an answer, or they are even inconsistent. I think an answer would be of high value to all PM app developers so it would be a good idea to publish in EDM/2 (if someone finds an answer to it).

Now for the question(s).

  1. What is the correct resource definition of the 'Help' menu. In some documentation I read there should be an MIS_HELP flag, some didn't set the flag. The same with MIS_SYSCOMMAND for the help menu items (and using menu id such as SC_HELPFORHELP). I suppose that question 2) is probably solved by the Help Manager if one has the correct help menu definition.
  2. What is the definition and code for the help menu to use OS/2 standard help texts for e.g. 'Using Help'. In addition OS/2 has standard help text items for the explanation of the help menu items, i.e. if you go on the 'Using Help' menu and press F1. I manually discovered that displaying these help panels can be accomplished by sending the Help Manager the following help panel numbers, but I wonder where they are documented:

    Help for menu items:

    • 'Help Index' - 64026
    • 'General Help' - 64024
    • 'Using Help' - 64023
    • 'Keys Help' - 64025
    • 'Help' menu itself - 64022

To answer your first question, there is no correct way. If you use the MIS_HELP flag, you have to intercept the WM_HELP message just like you would have to intercept the WM_COMMAND message without the MIS_HELP flag. For consistency, I usually omit the flag. What you do with the items is fairly standard (this answers your second question):

  • For "Help Index", send the Help Manager an HM_HELP_INDEX message.
  • For "General Help", send it an HM_EXT_HELP message.
  • For "Using Help", send it an HM_DISPLAY_HELP message with the two parameters set to 0.
  • For "Keys Help", send it an HM_KEYS_HELP message, to which it will respond by sending you an HM_QUERY_KEYS_HELP message. The proper reply is to send the resource id of the keys help panel.
John Bijnens ( writes:

A week ago I asked you if there was an OS/2 equivalent for errno and sys_errlist[]. You answered me no then. I've found now that it is possible to get the message string that belongs to an error number. The file OSO001.MSG that can be found in the directory \OS2\SYSTEM contains all the error messages. By using the function DosGetMessage you can get the text string that goes with a certain error number. So if you now have an error returned by DosRead() (for example) you can get the corresponding text string.

I've included a small source listing below. You're free to do with it what you like. Perhaps it is of use for someone. [Editor's note - the source is in the file DOSERROR.C] Not Available

Klaus Johannes Rusch ( writes:

One of the deficiencies of the REXX language is the limitation to one return value. While external data queues and files are possible means of communication, the code snippet below offers superior performance and usability.

This also proves useful when writing structured data of arbitrary length and contents to a file. (Admittedly, this was the author's first use of the Return() and ParseReturned() functions.)

  Return '|' || C2X(ARG(1));

  Return X2C(SUBSTR(ARG(1), 2));
The following example shows how to use these functions to return multiple values of arbitrary length and content:
/* REXX */
Parse Value MyProc(parms) With r1 r2 r3;
r1 = ParseReturned(r1);
r2 = ParseReturned(r2);
r3 = ParseReturned(r3);
/* : */
Exit 0;

MyProc: Procedure;
 Parse Arg parms;
 /* : */
 Return Return(r1) Return(r2) Return(r3);
[Editor's note - the source is in the file RETSAMP.CMD]Not Available