Anyone knows an ANSI way to call another Java program within C codes without replacing the caller process. _execlp is an API that is used to execute another program but it "terminates" the caller process and I don't want that.
No any ANSI ways in obvious non-ANSI C-Java contact.
TryJava Native Interface (JNI), see Java manuals for your platform.
It's so intricate and ill-documented issue. But it works (some years ago, on Windows NT and Solaris...
I used _spawnlp and it worked to bring up nodepad, windows explorer but failed to bring up power point and the Java plotting package. Any ideas on why it worked on certain executable files and not others? I am using windows XP and visual studio 6.0 to compile source codes. Thanks.
_spawnlp(_P_WAIT, "explorer", "C:\\C\\explorer.exe", NULL);
The above worked fine
but
_spawnlp (_P_WAIT, "Jplot", "C:\\C\\Jplot.exe", NULL); has error. It returns nonzero.
Are you catching the return value, this might help in determining the problem. Other than that it could be that these programs require parameters to be passed to them.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.