Microsoft KB Archive/93670

= Using Run on Program That Has Overlays Causes Incorrect Error =

PSS ID Number: 93670

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q93670



SYMPTOMS
Using the Run statement repetitively to run a program that contains overlays can result in one of the following incorrect error messages:

Too many files

Input path for run-time module VBDRT10E.EXE:

The &quot;Too many files&quot; error occurs if the program was compiled with the BC.EXE /O (stand-alone) option. The &quot;Input path for run-time module VBDRT10E.EXE:&quot; error occurs if the program was compiled without the /O option by using the default run-time module instead.



WORKAROUND
Here are three ways you can work around the problem:


 * Compile the program without overlays
 * Run the program in the interpreter (VBDOS.EXE) instead of using the Run statement.
 * Call the assembly language procedure shown below before using the Run statement.



STATUS
Microsoft has confirmed this to be a bug in the Professional Edition of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Call Assembly Language Procedure to Work Around Problem
You can work around this problem by calling the following assembly language procedure before using the Run statement: COP.ASM: .model medium, basic ; extern unsigned short __far __cdecl _movefpause extrn __movefpause:word ; extern void __far __cdecl _movepause( void ); extrn __movepause:Far __MOVE_PAUSE_DISK   equ   2 __MOVE_PAUSE_CACHE  equ   4 .code CloseOverlayPause proc mov   ax,seg __movepause      ; seg for __movefpause mov   es,ax mov   bx,es:__movefpause      ; get flags to modify or    bx,__MOVE_PAUSE_DISK    ; closes EXE or    bx,__MOVE_PAUSE_CACHE   ; shutdown caches mov   es:__movefpause,bx      ; put 'em back call  __movepause             ; execute pause ret CloseOverlayPause endp end Use MASM and the following command to assemble the procedure: MASM COP.ASM; To apply the workaround to your program, add the following Declare to the beginning of each module that uses Run: Declare Sub CloseOverlayPause Use the following code to call the procedure before using Run: Sub sub1 Print &quot;In SUB1&quot; Call CloseOverlayPause Run &quot;MAIN&quot; End Sub Use the following code to link the assembly language procedure into your program: LINK MAIN.OBJ COP.OBJ (SUB1.OBJ);

Steps to Reproduce Problem
 Start VBDOS.EXE.  Create a module named MAIN.BAS, and add the following code to it: Call sub1   Create a module named SUB1.BAS, and add the following code to it: Sub sub1 Print &quot;In SUB1&quot; Run &quot;MAIN&quot; End Sub  Exit from VBDOS.EXE.  Compile and link the modules using BC.EXE, LINK.EXE, and this code: BC /O MAIN.BAS; BC /O SUB1.BAS; LINK MAIN.OBJ (SUB1.OBJ);  Run the application MAIN.EXE. It eventually produces the &quot;Too many files&quot; error message.</li> To reproduce the &quot;Input path for run-time module VBDRT10E.EXE:&quot; error, compile the same program without using the /O option.</li></ol>

Additional query words: VBmsdos buglist1.00 1.00 errmsg

Keywords: KB93670

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.