Hi All
I have a C++ windows application.
I invoke this C++ app from my java program like this
Runtime.getRuntime().exec("cmd /c p:\\bin\\invokecpp.bat");
Is there a way I can check if my C++ program is up and running from my
java program which invoked it.
Please let me know.
Thanks
Andrew Thompson - 30 Jan 2007 20:30 GMT
...
> Is there a way I can check if my C++ program is up and running from my
> java program which invoked it.
Is that a question?
> Please let me know.
Please RTFM.
Look at what Runtime.exec() method returns,
then examine the methods of the returned
object.
Andrew T.
Ike - 30 Jan 2007 20:46 GMT
Try ctl-alt-del, check under the "processes tab." If it is running, you will
see it there. -Ike
Alex Hunsley - 01 Feb 2007 13:11 GMT
> Hi All
>
> I have a C++ windows application.
>
> I invoke this C++ app from my java program like this
> Runtime.getRuntime().exec("cmd /c p:\\bin\\invokecpp.bat");
> Is there a way I can check if my C++ program is up and running from my
> java program which invoked it.
>
> Please let me know.
Please try asking a question if you expect an answer.
http://en.wikipedia.org/wiki/Question_mark
Luc The Perverse - 01 Feb 2007 19:29 GMT
>> Hi All
>>
[quoted text clipped - 11 lines]
>
> http://en.wikipedia.org/wiki/Question_mark
I am all about proper posting techniques . . but I think you are being a
little bit too nit picky with this one.
--
LTP
:)
www - 01 Feb 2007 13:32 GMT
> Hi All
>
[quoted text clipped - 9 lines]
>
> Thanks
I guess you want to check if your C++ program has finished or not. You
want to wait until it terminated, then proceed to execute your next Java
code, right ?
Process pr = Runtime.getRuntime().exec("cmd /c p:\\bin\\invokecpp.bat");
//executing the script takes almost no time, but the C++ program
evoked by the script takes some time
pr.waifFor(); //this orders the machine to wait until your C++ program
or any subprocess evoked in last command to finish
System.out.println(pr.exitValue()); //it should print 0 now, which
means your C++ has ended normally