Hi all,
I use the following code to make a vb.exe to return a value and I get the value from another application. However, I don't know why I always get 0 from the application2. In fact, application2 should get 1 instead of 0.
Application1:
Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
Private Sub Form_Load()
ExitProcess 1
end sub
Application2:
Private Sub Form_Load()
Dim job As String
Dim retVal As Long
Dim hProcess As Long
BinComparsion = False
job = "D:\FTPGateway\Testing\Project1"
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION,
False, Shell(job, 1))
Do
GetExitCodeProcess hProcess, retVal
DoEvents: Sleep 100
Loop While retVal = STILL_ACTIVE
MsgBox retVal
End Sub
Does anyone know how to solve this problem?
Any responses are welcome
Thanks
Alice
I use the following code to make a vb.exe to return a value and I get the value from another application. However, I don't know why I always get 0 from the application2. In fact, application2 should get 1 instead of 0.
Application1:
Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
Private Sub Form_Load()
ExitProcess 1
end sub
Application2:
Private Sub Form_Load()
Dim job As String
Dim retVal As Long
Dim hProcess As Long
BinComparsion = False
job = "D:\FTPGateway\Testing\Project1"
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION,
False, Shell(job, 1))
Do
GetExitCodeProcess hProcess, retVal
DoEvents: Sleep 100
Loop While retVal = STILL_ACTIVE
MsgBox retVal
End Sub
Does anyone know how to solve this problem?
Any responses are welcome
Thanks
Alice