Solved

using a java class in a C++ application

Posted on 1998-09-04
3
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

688 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