Board index » cppbuilder » fire off and wait for executable jar

fire off and wait for executable jar


2008-03-07 05:45:21 AM
cppbuilder102
Hi.
I am using cbuilder 6.
I'm wondering is there any 'recommended' way to fire off an executable
jar file from within my application? I need to wait for it's
completion, and then check to see if it left any files behind. This is
strictly windows.
thanks
Jeff
 
 

Re:fire off and wait for executable jar

On Mar 6, 4:45 pm, kishjeff < XXXX@XXXXX.COM >wrote:
Quote
Hi.

I am using cbuilder 6.
I'm wondering is there any 'recommended' way to fire off an executable
jar file from within my application? I need to wait for it's
completion, and then check to see if it left any files behind. This is
strictly windows.

thanks
Jeff
more.. I tried ShellExecute passing java as the filename and the
parameters in the parameter string, but all I got was a brief dos box
flash.
I put it all in a bat file, but the same thing happened when I used
ShellExecute on the bat file.
I guess I need to try to get the return code from the bat file into my
application.
 

Re:fire off and wait for executable jar

On Mar 7, 10:48 am, kishjeff < XXXX@XXXXX.COM >wrote:
Quote
On Mar 6, 4:45 pm, kishjeff < XXXX@XXXXX.COM >wrote:

>Hi.

>I am using cbuilder 6.
>I'm wondering is there any 'recommended' way to fire off an executable
>jar file from within my application? I need to wait for it's
>completion, and then check to see if it left any files behind. This is
>strictly windows.

>thanks
>Jeff

more.. I tried ShellExecute passing java as the filename and the
parameters in the parameter string,  but all I got was a brief dos box
flash.
I put it all in a bat file, but the same thing happened when I used
ShellExecute on the bat file.
I guess I need to try to get the return code from the bat file into my
application.
Ahh. it works. ShellExecute all by itself worked. (I forgot to delete
some files that caused the
jar executable to just be silent).. but how can I get the code
returned by the jar application into
my c++ app?
 

{smallsort}

Re:fire off and wait for executable jar

On Mar 7, 10:58 am, kishjeff < XXXX@XXXXX.COM >wrote:
Quote
On Mar 7, 10:48 am, kishjeff < XXXX@XXXXX.COM >wrote:





>On Mar 6, 4:45 pm, kishjeff < XXXX@XXXXX.COM >wrote:

>>Hi.

>>I am using cbuilder 6.
>>I'm wondering is there any 'recommended' way to fire off an executable
>>jar file from within my application? I need to wait for it's
>>completion, and then check to see if it left any files behind. This is
>>strictly windows.

>>thanks
>>Jeff

>more.. I tried ShellExecute passing java as the filename and the
>parameters in the parameter string,  but all I got was a brief dos box
>flash.
>I put it all in a bat file, but the same thing happened when I used
>ShellExecute on the bat file.
>I guess I need to try to get the return code from the bat file into my
>application.

Ahh. it works. ShellExecute all by itself worked. (I forgot to delete
some files that caused the
jar executable to just be silent).. but how can I get the code
returned by the jar application into
my c++ app?- Hide quoted text -

- Show quoted text -
ok.. this worked fine and I got the return code back..
spawnlp(P_WAIT,"mydir\\dojava.bat","mydir\\dojava.bat","parm1",
"parm2","parm3",NULL);
thanks to a precambrian post in a related newsgroup! took a while to
find.