G
Guest
I'm using some "shell out and wait for it to complete" code I found on the
'net. Actually I found several versions, all of them basically the same. My
version looks like this...
Declare Function CreateProcessA Lib "kernel32" (ByVal lpApplication As
Variant, ByVal lpCommandLine As Variant, ByVal lpProcessAttributes As Long,
ByVal lpThreadAttributes As Long, ByVal bInheritHandle As Integer, ByVal
dwCreationFlags As Long, ByVal lpEnvironment As Long, ByVal
lpCurrentDirectory As Variant, ByRef lpStartupInfo As STARTUPINFO, ByRef
lpProcessInfo As PROCESS_INFORMATION) As Integer
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long,
ByVal dwMilliseconds As Long) As Long
.... then in the sub that handles it...
Dim si As STARTUPINFO
si.cb = Len(si)
si.dwFlags = STARTF_USESHOWWINDOW
si.wShowWindow = SW_SHOWNORMAL
bRet = CreateProcessA(0, lpApp, 0, 0, 0, NORMAL_PRIORITY_CLASS, 0, 0, si,
pi)
Access crashes on the last line, and restarts.
Anyone out there doing something similar and has it working ok?
Maury
'net. Actually I found several versions, all of them basically the same. My
version looks like this...
Declare Function CreateProcessA Lib "kernel32" (ByVal lpApplication As
Variant, ByVal lpCommandLine As Variant, ByVal lpProcessAttributes As Long,
ByVal lpThreadAttributes As Long, ByVal bInheritHandle As Integer, ByVal
dwCreationFlags As Long, ByVal lpEnvironment As Long, ByVal
lpCurrentDirectory As Variant, ByRef lpStartupInfo As STARTUPINFO, ByRef
lpProcessInfo As PROCESS_INFORMATION) As Integer
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long,
ByVal dwMilliseconds As Long) As Long
.... then in the sub that handles it...
Dim si As STARTUPINFO
si.cb = Len(si)
si.dwFlags = STARTF_USESHOWWINDOW
si.wShowWindow = SW_SHOWNORMAL
bRet = CreateProcessA(0, lpApp, 0, 0, 0, NORMAL_PRIORITY_CLASS, 0, 0, si,
pi)
Access crashes on the last line, and restarts.
Anyone out there doing something similar and has it working ok?
Maury