Solved

using a java class in a C++ application

Posted on 1998-09-04
3
158 Views
Last Modified: 2010-04-02
Hi,
I have created a java class and now I'd like to use it in a C++ application. Do you know how to do this?
Thanks
0
Comment
Question by:stef3
3 Comments
 

Author Comment

by:stef3
ID: 1172044
Edited text of question
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1172045
Crude solution if your Java code can run in an applet:

You need IE installed on the same PC.

     1. Use the Web Browser control (SHDOCVW.DLL), insert this into your form.
     2. Make a dummy HTML page which references the applet (just like if you were putting the applet on the web).  Save this as a file.
     3. Use the Navigate function in the Web Browser control to bring up the dummy HTML page.  [it can navigate to local files as well as web sites]

     Incidentally the dummy HTML file can either be distributed with your app, be on a web site somewhere or you can create a local file using the C++ file functions (HTML
     pages are just ASCII text after all)
0
 

Accepted Solution

by:
cheehong earned 60 total points
ID: 1172046
I would assume that your java classes are not applet.  A neater way will be to use JNI. (Java Native Interface)

I would not quote the example here.  But you can find out further details from the article titled:
Merging Java and Win32: A new way to develop Windows applications
Learn how to write Win32 applications in Java instead of C++ -- and save yourself some time and effort!

from JavaWorld at http://www.javaworld.com/javaworld/jw-07-1998/jw-07-java-win32.html

Enjoy! 8)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now