header file to include java classes?
Swapnil.Kale
swapnil.kale@gmail.com
Wed Dec 19 14:28:00 GMT 2007
Hi,
Let me be more specific on this.
I've a C++ dll which is calling FORTE (the language developed by SUN
10/15 yrs back. Now it is outdated). Now after I migrate the project
to JAVA (Forte was pretty similar to JAVA), My task would be to call
the Java programs into the existing C++ dlls.
I could use the JVM and the getobject methods etc...using JVM
creattion in C++.
My problem: The existing header files of the dlls / C++ contains the
type of the classes .
/*
// EnvironmentHandle.h: interface for the EnvironmentHandle class.
*/
e.g. qqhEnvironmentHandleClass * GetForteHandle(void) { return
m_ForteEnvHandle;}
qqhEnvironmentHandleClass was a Forte class which is a
EnvironmentHandleClass in Java now. (not reflected in the code),
The new code could be EnvironmentHandleClass * GetForteHandle(void)
{ return m_ForteEnvHandle;}
//just an assumption, didnt find the right way yet.
Now How do I refer this converted Java Class in the C++ header.
How do I tell the C++ header where to look for the Java classs?
Regards,
Swapnil
------------------------------------------------------------
Swapnil.Kale wrote:
>> Hi,
> I'm working on a Migration project (Forte to JAVA).
>> The forte client had a C++ dll which used to call one more FORTE dll for a
> complex database calculations.
>> Now all the forte code has been migrated to JAVA except this piece of
> code where C++ dll calls Forte DLL.
>>> I'm using JNI to call the Java classes from C++. Some of the methods in
> C++ has the header files where the signature has reference to the Forte
> Classes (Which are now Java Classes).
>> How do I change the header files to include Java classes in the signature?
>> (I couldnt find a strong reference for this, but i assume that for all the
> classes in Java I'll need to create the .h file using javah utility.
>>> Here is the Sample in one of the C++ header files:
>> qqhConnectionHandleClass * m_ForteConnHandle; //qqhConnectionHandleClass
> was Forte class which is now a ConnectionHandleClass in Java.
>>> HWND m_hwndParent;
> int m_autocommit;
> StatementHandle * m_StmtHandles;
> ....
>> Almost all the signatures in the header files of C++, have references to
> Forte / Java classes.
>> Do I need to use javah and create a header file for the classes and then
> include in the C++ header file?
>>> In the implementation class (C++) just including jni.h solves my problem
> as it is enough to create the jvm and loading classes/ executing methods..
>>> Any help is appreicated.
>> Newbie in C++ :)
>> Thanks,
> Swapnil.
>>>>>
-----
Swapnil Kale Think before you print
________________________________________
:working:
--
View this message in context: http://www.nabble.com/header-file-to-include-java-classes--tp14416171p14417954.html
Sent from the gcc - java mailing list archive at Nabble.com.
More information about the Java
mailing list