
Executing a 16 bit app from a 32 bit app
Any help would be greatly appreciated!!
I have a 32 bit app that I developed using VB4.0 and from it I give the
user the option of launching one of two 16 bit apps. When the 16 bit app
is executed I want the 32 bit app to wait for the 16 bit app to complete.
I am running this in Windows NT 3.51
The following is the code I use to launch the 16 bit app.
NOTE: static_com$ contains the string to startup the 16 bit app.
1: Dim start As STARTUPINFO
2: start.cb = Len(start)
3: Iret% = CreateProcessA(0&, static_com$, 0&, 0&, 1&,
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
4: Iret% = CloseHandle(proc.hThread)
5: Iret% = WaitForSingleObject(proc.hProcess, INFINITE)
6: If (Iret% <> WAIT_FAILED) Then
7: lRet& = GetExitCodeProcess(proc.hProcess, dwExitCode&)
8: End If
9: Iret% = CloseHandle(proc.hProcess)
My problem is at line 5:. When I exit the 16 bit app the 16 bit app freezes.
In order for the 32bit app to proceed I have to kill the 16 bit app from the
task list. When this is done lines 6 - 9 are executed.
Am I doing this right?
Does any one have any suggestions?
Again, any help would be greatly appreciated!!
A. Gray
TAMSCO
5030 Herzel Pl.
Beltsville MD 20705