Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
Could anyone tell me why this is happening, while i am still trying to find any solution on the net. My knowledge about VB6 is very limited. Thanks!!
Our company has a small VB6 program, and so far I have managed to change it to run Acrobat.exe to view PDF files, using the Shell command. Problem happens when I close acrobat.exe (clicking the x at the left coner, or choosing File, exit) - it also closes the VB6 program! while it is supposed to be running until the user closes it.
But if I try to use it to open a txt file with notepad.exe, and close notepad.exe, it is ok - it does not close the VB6 program.
So how come it happens to the acrobat.exe and microsoft excell.exe, but not notepad.exe
extracted code:
success = FindExecutable(fileToOpen, filePath, sRusult)
If (success > 32) Then
pos = InStr(sRusult, Chr$(0))
If pos Then
exeProg = Left$(sRusult, pos - 1)
End If
runExe = Shell(sRusult & " " & filename, vbNormalFocus)
Else
...
...
thankswtk

sorry, typing error:
If (success > 32) Then
pos = InStr(sRusult, Chr$(0))
If pos Then
sRusult = Left$(sRusult, pos - 1) ' not exeProg
End IfrunExe = Shell(sRusult & " " & filename, vbNormalFocus)
Else
...
...

I suspect the problem is later on in the code; as soon as VB6 gets the PID from Windows, the program should continue on past the shell command.

hi,
the VB6 program continues, and it actually does nothing after the Shell command.
and if i continue to use this program to open another PDF file, the already-open acrobat.exe displays this file without error.
but closing acrobat.exe, it also closes (maybe clashes?) the VB6 program.
thanks
wtk

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |