473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Java from VC++

I am writing a VC++ program that has to fetch a Java source file,
compile it with a Java compiler, execute it at runtime, and return the
result objects back to VC++. Do you know of any sample codes to
illustrate how that works, or any suggestions?
Jul 23 '05 #1
2 1538

ToSam wrote:
I am writing a VC++ program that has to fetch a Java source file,
compile it with a Java compiler, execute it at runtime, and return the result objects back to VC++. Do you know of any sample codes to
illustrate how that works, or any suggestions?


There are some things that you can actually do in C++ (fetch a file,
probably - what exactly do you want to do?), execute a program
( std::system("path/to/javac.compiler") or std::exec* functions ),
and IIRC the Java file that is produced can be run again using
a similar std::system command.

I'm not sure what you mean with the "result objects". The closest
thing to a result object in C++ is the single int returned from
int main( ). But I could imagine the Java program producing an
output file. You could read that back in C++. In fact, since Java
sources are just text, and C++ can manipulate text, you could also
modify the Java source text before you compile it, such that the
output objects are stored to a file.

HTH,
Michiel Salters

Jul 23 '05 #2
"msalters" <Mi*************@logicacmg.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
There are some things that you can actually do in C++ (fetch a file,
probably - what exactly do you want to do?), execute a program
( std::system("path/to/javac.compiler") or
std::exec* functions ),


There are no functions in the C++ standard library
whose names begin with 'exec'.

-Mike
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Beatrice Rutger | last post by:
Hi, I am a previous Micro$oft desertee (moved from VB/VC++ to Java before this whole DOTNET thing) because I had several issues with Micro$oft. I am not completely in love with Windoze, but I...
4
by: dalewz | last post by:
Hi, Could sb kindly answer my following questions: Plan: I am trying to find a language to build a GUI to communicate with our device via serial port. Questions: 1. which language (VC++...
133
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
8
by: Beatrice Rutger | last post by:
Hi, I am a previous Micro$oft desertee (moved from VB/VC++ to Java before this whole DOTNET thing) because I had several issues with Micro$oft. I am not completely in love with Windoze, but I...
12
by: Von Clubusev | last post by:
I like Java just as much as I like C#, but the truth is that unless you absolutely need platform portability, DotNet is the way to go. This is becoming even more true with the release of Windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.