D
dorkrawk
Hey, I'm working with a Java Native Interface from managed C++
(MS Visual C++ .net 2003... if these details help) and I keep having
issues with mixing managed and nonmanaged types for example...
causes this error (error thrown on JNI_CreateJavaVM() call)....
jni.cpp(34) : error C2440: 'type cast' : cannot convert from 'JNIEnv
*__gc * ' to 'void ** '
Cannot convert a managed type to an unmanaged type
jni.cpp(34) : error C2664: 'JNI_CreateJavaVM' : cannot convert
parameter 1 from 'JavaVM *__gc * ' to 'JavaVM ** '
Cannot convert a managed type to an unmanaged type
I've tried all sorts of __nogc stuff but it keeps throwing these errors
on build. Does anybody have any ideas or has anyone else worked w/ JNI
within managed C++?
(MS Visual C++ .net 2003... if these details help) and I keep having
issues with mixing managed and nonmanaged types for example...
Code:
__value __nogc struct JNI_Interface
{
JavaVM __nogc *jvm; /* denotes a Java VM */
JNIEnv __nogc *env; /* pointer to native method interface */
//static jobject phone_obj; // phone object to make JNI calls to PTF
with
int jni_startJVM();
int jni_checkException(char* jni_call);
int jni_startCom();
};
Code:
JNI_Interface::jni_startJVM()
{
....
jint res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args); // error on
this line
....
}
causes this error (error thrown on JNI_CreateJavaVM() call)....
jni.cpp(34) : error C2440: 'type cast' : cannot convert from 'JNIEnv
*__gc * ' to 'void ** '
Cannot convert a managed type to an unmanaged type
jni.cpp(34) : error C2664: 'JNI_CreateJavaVM' : cannot convert
parameter 1 from 'JavaVM *__gc * ' to 'JavaVM ** '
Cannot convert a managed type to an unmanaged type
I've tried all sorts of __nogc stuff but it keeps throwing these errors
on build. Does anybody have any ideas or has anyone else worked w/ JNI
within managed C++?