ConfusedMike
asked on
Capturing DOS output from VB6
Hello all,
I am shelling this line of code from VB6 to compile various .java files into classes:
"C:\jdk1.3.1_02\bin\javac -d D:\Temp\SPACE\java_classes \ -classpath D:\Temp\SPACE\java_classes \;D:\Dev\J ava\com\ca libre\spac e\mail.jar ;D:\Dev\Ja va\com\cal ibre\space \servlet.j ar D:\Dev\Java\com\calibre\sp ace\*.java "
This works fine if no problems are encountered in the compile process. But fails if one of the files doesn't compile. No error messages display though to tell the user something has gone wrong. If I run the above command in a DOS window, then I get some error messages that are useful. I was hoping to be able to catch these error messages & relay them back to my VB app so that the user can see what's going on if the command should fail.
I have searched the microsoft website & found some info (http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q173/0/85.ASP&NoWebContent=1), but unfortunately I can't get their example to work!
If any one can offer any suggestions I would be most grateful. Thank you in advance for your help.
Michael.
I am shelling this line of code from VB6 to compile various .java files into classes:
"C:\jdk1.3.1_02\bin\javac -d D:\Temp\SPACE\java_classes
This works fine if no problems are encountered in the compile process. But fails if one of the files doesn't compile. No error messages display though to tell the user something has gone wrong. If I run the above command in a DOS window, then I get some error messages that are useful. I was hoping to be able to catch these error messages & relay them back to my VB app so that the user can see what's going on if the command should fail.
I have searched the microsoft website & found some info (http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q173/0/85.ASP&NoWebContent=1), but unfortunately I can't get their example to work!
If any one can offer any suggestions I would be most grateful. Thank you in advance for your help.
Michael.
ASKER
Hi Ryancys,
Thanks for your reply. Unfortunately I experienced the same problem that Trowa encountered when trying to get the Microsoft example code to work for the javac command (the app hangs on the ReadFile call).... and it seems that on that thread no solution was found to this problem :(
Michael.
Thanks for your reply. Unfortunately I experienced the same problem that Trowa encountered when trying to get the Microsoft example code to work for the javac command (the app hangs on the ReadFile call).... and it seems that on that thread no solution was found to this problem :(
Michael.
The Microsoft has a good example for this:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvbtips/html/msdn_msdn75.asp
Then read at tips 12
Thanks & Cheers
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvbtips/html/msdn_msdn75.asp
Then read at tips 12
Thanks & Cheers
ASKER
Thanks Fantasy, but I'm not dealing with menu items (unless I've misunderstood!). I have however since found a working example..... I've lost the URL (doh). Is it possible to attach files to a thread, so that I can share it?
Michael.
Michael.
Not, just follow the link, and choose the tip12 from the left menu. try again
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvbtips/html/msdn_msdn12.asp
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvbtips/html/msdn_msdn12.asp
ASKER
Thanks man. As I say though, I now have a working example which I found elsewhere on the net. I'm going to try & find the link again so I can post it here for folk.
ASKER
Got it. Here it is:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=32180&lngWId=1
This worked a treat (first time & with the minimum of fuss!).
So I guess this question can now be closed. Thanks for your efforts.
Michael.
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=32180&lngWId=1
This worked a treat (first time & with the minimum of fuss!).
So I guess this question can now be closed. Thanks for your efforts.
Michael.
shd i suggest you some other alternative
why don't u put the dos output to a text file and then after the execution of dos command check that txt file(read it)
dos ha redirectional command..like
dir>>a.txt will redirect dir to a.txt file
tell me if u liked that
why don't u put the dos output to a text file and then after the execution of dos command check that txt file(read it)
dos ha redirectional command..like
dir>>a.txt will redirect dir to a.txt file
tell me if u liked that
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://www.experts-exchange.com/questions/20309433/Return-the-content-of-DOS-Prompt.html