tjbradford
Technical User
Private Declare Function GetModuleUsage% Lib "Kernel" _
(ByVal hModule%)
Private Function TestFunc(ByVal lVal As Long) As Integer
'this function is necessary since the value returned by Shell is an
'unsigned integer and may exceed the limits of a VB integer
If (lVal And &H8000&) = 0 Then
TestFunc = lVal And &HFFFF&
Else
TestFunc = &H8000 Or (lVal And &H7FFF&)
End If
End Function
Sub Form_Click()
lRet& = Shell("tcpdump -i 3 ") ' Modify the path as necessary.
MsgBox "1"
x% = TestFunc(lRet&)
While GetModuleUsage(x%) > 0 ' Has Shelled program finished?
z% = DoEvents() ' If not, yield to Windows.
Wend
MsgBox "Shelled application just terminated", 64
End Sub
is this a bad example from microsoft?
I want to shell a dos program and from what i understand cmd is a 16bit enviroment is that correct?
(ByVal hModule%)
Private Function TestFunc(ByVal lVal As Long) As Integer
'this function is necessary since the value returned by Shell is an
'unsigned integer and may exceed the limits of a VB integer
If (lVal And &H8000&) = 0 Then
TestFunc = lVal And &HFFFF&
Else
TestFunc = &H8000 Or (lVal And &H7FFF&)
End If
End Function
Sub Form_Click()
lRet& = Shell("tcpdump -i 3 ") ' Modify the path as necessary.
MsgBox "1"
x% = TestFunc(lRet&)
While GetModuleUsage(x%) > 0 ' Has Shelled program finished?
z% = DoEvents() ' If not, yield to Windows.
Wend
MsgBox "Shelled application just terminated", 64
End Sub
is this a bad example from microsoft?
I want to shell a dos program and from what i understand cmd is a 16bit enviroment is that correct?