Computing.Net > Forums > Programming > VB6 Shell command closing prg

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB6 Shell command closing prg

Reply to Message Icon

Name: wt (by think)
Date: February 20, 2008 at 17:41:19 Pacific
OS: windows 2003 server
CPU/Ram: ?
Product: ?
Comment:

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
...
...


thanks

wtk




Sponsored Link
Ads by Google

Response Number 1
Name: wt (by think)
Date: February 20, 2008 at 17:42:51 Pacific
Reply:

sorry, typing error:

If (success > 32) Then
pos = InStr(sRusult, Chr$(0))
If pos Then
sRusult = Left$(sRusult, pos - 1) ' not exeProg
End If

runExe = Shell(sRusult & " " & filename, vbNormalFocus)
Else
...
...


0

Response Number 2
Name: Razor2.3
Date: February 20, 2008 at 18:04:19 Pacific
Reply:

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.


0

Response Number 3
Name: wt (by think)
Date: February 20, 2008 at 19:50:55 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB6 Shell command closing prg

VB6 Shell - changing thread prioriy www.computing.net/answers/programming/vb6-shell-changing-thread-prioriy/8893.html

Visual Basic shell command or run www.computing.net/answers/programming/visual-basic-shell-command-or-run/14913.html

vb shell command in win 2000 www.computing.net/answers/programming/vb-shell-command-in-win-2000/5429.html