emilioantonio
Technical User
Hi all
I developed a VB6 application that at a certain point runs an external program (Winvam.exe) with the following code:
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32.dll" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Private Const SYNCHRONIZE = &H100000
Private Const INFINITE = &HFFFFFFFF
Private Sub ProcessHandle(Process_ID As String)
Dim Process_Handle
On Error GoTo 0
Process_Handle = OpenProcess(SYNCHRONIZE, 0, Process_ID)
If Process_Handle <> 0 Then
DoEvents
Call WaitForSingleObject(Process_Handle, INFINITE)
Call CloseHandle(Process_Handle)
End If
End Sub
ProcessHandle (Shell("c:\devplan3d\surface\Winvam.exe"))
At least 1 time in three I get the following error:
Winvam: Winvam.exe - Application error
Rhe instruction at "oxoo632ce2" referenced memory at "0xc73f4a05. The memory could not be "written"
Click ok to terminate the program
Click cancel to debug the program
I never get this error when I run the program directly.
Has anyone an idea of what is going on ?
Thanks for your help
emilioantonio
I developed a VB6 application that at a certain point runs an external program (Winvam.exe) with the following code:
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32.dll" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Private Const SYNCHRONIZE = &H100000
Private Const INFINITE = &HFFFFFFFF
Private Sub ProcessHandle(Process_ID As String)
Dim Process_Handle
On Error GoTo 0
Process_Handle = OpenProcess(SYNCHRONIZE, 0, Process_ID)
If Process_Handle <> 0 Then
DoEvents
Call WaitForSingleObject(Process_Handle, INFINITE)
Call CloseHandle(Process_Handle)
End If
End Sub
ProcessHandle (Shell("c:\devplan3d\surface\Winvam.exe"))
At least 1 time in three I get the following error:
Winvam: Winvam.exe - Application error
Rhe instruction at "oxoo632ce2" referenced memory at "0xc73f4a05. The memory could not be "written"
Click ok to terminate the program
Click cancel to debug the program
I never get this error when I run the program directly.
Has anyone an idea of what is going on ?
Thanks for your help
emilioantonio