Basic 7.0 UEVENT Example Causes Subsequent Programs to Hang (59399)






This article was previously published under Q59399

SYMPTOMS

The sample program for trapping a user-defined event on Pages 310-312 of the "Microsoft Basic 7.0: Programmer's Guide" for Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 contains a misprint, but even if corrected, this sample program may cause the computer to hang after it is run.

STATUS

Microsoft has confirmed this to be a bug in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Page 311 of "Microsoft Basic 7.0: Programmer's Guide" contains a misprint in the MASM programming example for trapping a user-defined event. If the code is not corrected, an "A2009: Symbol not defined" error will result when the code is assembled.

The last section of code for this example reads as follows:
    RestInt  proc  uses ds
       lds dx, cs:OldVector
       mov  x, 251CH          ; <== this line contains the misprint
				
To correct the code, make the following change:
    RestInt  proc  uses ds
       lds dx, cs:OldVector
       mov ax, 251CH          ; <== change "x" to "ax"
				
However, even when this misprint is corrected, if the Basic program is compiled so that it requires a run-time module or if the assembly code is put into a Quick library, running the program may cause the computer to hang. The problem does not occur if the Basic program is compiled with the BC /O option.

The following compiling and linking steps will reproduce the problem:

  1. Assemble the MASM code as follows:
          MASM MASMPROG.ASM;
  2. Compile the Basic code so that it requires a run-time module (no /O) and enables event trapping (/V). If the program is compiled as a stand-alone program (with the /O option), the problem does not exist.
          BC BASPROG.BAS /V;
    						
  3. LINK the program using the Basic PDS 7.00 or 7.10 linker, as follows:
          LINK BASPROG.OBJ + MASMPROG.OBJ;
    						
  4. Run the program.
  5. The computer may hang instantly or may hang after attempting to run another program, such as QBX.EXE.

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: KB59399