SHELL | wait | overflow error

SHELL | wait | overflow error

Post by Frank Hag » Wed, 21 Aug 1996 04:00:00

I have a VB 4.0 16 bit application that allows the user to select a
number of files and sequentially open them using their choice of
program.  The form has a TextBox for the path and name of the program
they wish to use, a DriveListBox, DirListBox and FileListBox for
selection of the files to be opened, and a ListBox that contains the
files they have selected.  

The knowledge base has a method to shell and test for the end of the
program being called, using the Windows API.  It requires the
following declaration in the General Procedures section of the form's
Private Declare Function GetModuleUsage% Lib "Kernel" (ByVal hModule%)

Using that function, I want to SHELL to the editor listed in the text
box once for each of the files listed in the ListBox when the user
clicks on a command button. When the user closes the shelled program,
my application  restarts it with the next file.   Here is the code for
that portion of the program:
Private Sub Command5_Click()
  Dim X As Integer
  Dim RetVal As Integer
  Dim ProgOpen As Integer
  Dim ComLine As String

  ' Text1  contains the program I'm shelling to
  ' List1.List(X) contains the path/filename the program is to open
  ' ComLine is my command line I'm shelling out to

  For X = 0 To List1.ListCount - 1
    ' following line has been tried with and without 'Trim$' functions
    ComLine = Trim$(Text1) & " " & Trim(List1.List(X))
    RetVal = Shell(ComLine, 1)
    While GetModuleUsage(RetVal) > 0   ' Has Shelled program finished?
         ProgOpen = DoEvents()                 ' If not, yield
End Sub

The program generates a "Run time error '6':  Overflow" message, but
will shell out to each instance of the called program anyway.  Using
the  Debug.Print method I can see that the command line ... "ComLine"
above ... is formatted correctly.  It appears that when "RetVal"
returns a zero,  the overflow occurs.  In any case, the error seems to
happen on the "RetVal  = Shell(ComLine, 1)" line.

Any suggestions?


1. svrmgrl error when executed on root shell(all shells excepts oracle shell)


I have installed oracle8 server in digital unix.
when I execute 'svrmgrl' on oracle8 shell, it works well out.
But when i execute it on the other shells belong to dba group,  Fatal
error occured as follow.

543:/oradata1/oracle8/app/oracle/product/8.0.5/bin/oracle: /sbin/loader:
Fatal E
rror: cannot map
/sbin/loader: Fatal
 Error: cannot map
ORA-12547: TNS:lost contact

Can anybody help me with this?

Thank you.

2. Date-Time

3. Getting VB to wait on a SHELL process?

4. Btrieve Pros?

5. Wait/No wait option, transaction and ODBC

6. HELP starting SQL Executive

7. Users Waiting - What resource are they waiting on

8. Help ...Oracle web server & PL/SQL

9. Process waiting after issuing OPEN CURSOR, onstat shows a thread in waiting condition await_MC1

10. q: buffer busy wait(data block wait) when P3=130

11. PL/SQL log sync waits, log file parallel write waits and redo writes

12. Execute a shell script from a stored procedurExecute a shell script from a stored proceduree

13. Shelling out to run a shell