Microsoft KB Archive/59989

Symbolic Constants for KBDINFO Flags Missing from BSESUB.H PSS ID Number: Q59989 Article last modified on 04-09-1990 PSS database name: O_Os2SDK

1.01

OS/2

Question:

I have Version 1.20 of the Presentation Manager (PM) Toolkit and I am using the KbdSetStatus function. Within this function, I use the KBDINFO structure. I pass the fsMask parameter to the KBDINFO structure. The flag set for fsMask is KEYBOARD_ECHO_ON. When I compile my application, I receive the error message “C2029 error, KEYBOARD_ECHO_ON; undefined.” This same function worked properly with Version 1.10 of the PM Toolkit. Why won’t it work with Version 1.20?

Response:

In Version 1.20 of the PM Toolkit, KEYBOARD_ECHO_ON and other symbolic constants for the KBDINFO masks were mistakenly omitted from the header file BSESUB.H.

The following are two workarounds for this problem:

  Instead of using the symbolic constants for the KBDINFO masks, you can use the actual values that correspond to the KBDINFO symbolic constants. For example, instead of using the following assignment Kbdinfo.fsMask = KEYBOARD_ECHO_ON; you could use the following assignment: Kbdinfo.fsMask = 0x0001; // KEYBOARD_ECHO_ON This solution has the negative side-effect that you are using hard-coded values in your code. Code that uses symbolic constants is generally more flexible and easier to maintain.   Modify the header file BSESUB.H so that it includes all the symbolic constants for the KBDINFO masks that were inadvertently left out. This workaround to the problem is probably the best approach to take, but you might want to keep an unedited copy of the original file BSESUB.H for archival purposes. The symbolic constants for the KBDINFO masks are as follows: /* KBDINFO.fsMask */
 * 1) define KEYBOARD_ECHO_ON 0x0001 #define KEYBOARD_ECHO_OFF 0x0002 #define KEYBOARD_BINARY_MODE 0x0004 #define KEYBOARD_ASCII_MODE 0x0008 #define KEYBOARD_MODIFY_STATE 0x0010 #define KEYBOARD_MODIFY_INTERIM 0x0020 #define KEYBOARD_MODIFY_TURNAROUND 0x0040 #define KEYBOARD_2B_TURNAROUND 0x0080 #define KEYBOARD_SHIFT_REPORT 0x0100 

Copyright Microsoft Corporation 1990.