Srinimusuku
Dec 8th, 2000, 11:03 AM
I have the following code in VB.
My intension is to wait until the user closes the dos program and then resume the remaining VB code.
'start program
Public Declare Function GetModuleUsage Lib "Kernel32" (hModule As Long)
Private Sub Command1_Click()
WaitShell "c:\winnt\system32\command.com"
'resume the following codr after the dos is closed
dim x as integer
x=10
...
..
End Sub
Private Function WaitShell(appname As String)
Dim hMod As Long
hMod = Shell(appname, 1)
If (Abs(hMod) > 32) Then
While (GetModuleUsage(hMod))
DoEvents
Wend
Else
MsgBox "Unable to start " & appname
End If
End Function
'end program
****
But when i run the above code, i always get the error
***
"Can't find DLL entry GetModuleUsage in Kernel32"
"Run Time error 453"
***
May be iam not using the DLL correctly, please correct me.
Or please give me any other solution.
Urgent please
Thanks
My intension is to wait until the user closes the dos program and then resume the remaining VB code.
'start program
Public Declare Function GetModuleUsage Lib "Kernel32" (hModule As Long)
Private Sub Command1_Click()
WaitShell "c:\winnt\system32\command.com"
'resume the following codr after the dos is closed
dim x as integer
x=10
...
..
End Sub
Private Function WaitShell(appname As String)
Dim hMod As Long
hMod = Shell(appname, 1)
If (Abs(hMod) > 32) Then
While (GetModuleUsage(hMod))
DoEvents
Wend
Else
MsgBox "Unable to start " & appname
End If
End Function
'end program
****
But when i run the above code, i always get the error
***
"Can't find DLL entry GetModuleUsage in Kernel32"
"Run Time error 453"
***
May be iam not using the DLL correctly, please correct me.
Or please give me any other solution.
Urgent please
Thanks