Solved

using a java class in a C++ application

Posted on 1998-09-04
3
163 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

726 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