D
dorkrawk
I am having an issue with some VC++ I am writing. I have a struct and
I'm trying to call a function from it from a function in another
object.
here is the struct....
here are the function defs...
here is the call...
I am getting this error...
[error]
error C2662: 'JNI_Interface::jni_startCom' : cannot convert 'this'
pointer from 'JNI_Interface' to 'const JNI_Interface &'
[/error]
all the other online research I've done told me that if I changed these
functions to const that would fix this issue, but it still remains.
Any ideas?
I'm trying to call a function from it from a function in another
object.
here is the struct....
Code:
struct JNI_Interface
{
JavaVM *jvm; /* denotes a Java VM */
JNIEnv *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) const;
int jni_startCom() const;
};
here are the function defs...
Code:
JNI_Interface::jni_startCom() const
{
const char* phone_class_name = "phonetest/phone/synergy/SynergyPhone";
// class of phone to use
.....
}
here is the call...
Code:
in mobilePhone class...
private:
JNI_Interface ptfPhone;
mobilePhone::com_startCom()
{
// Added for JNI interface with PTF
if(comPort == "PTF")
{
int teh_test = ptfPhone.jni_startCom(); // for testing
return 0;
}
I am getting this error...
[error]
error C2662: 'JNI_Interface::jni_startCom' : cannot convert 'this'
pointer from 'JNI_Interface' to 'const JNI_Interface &'
[/error]
all the other online research I've done told me that if I changed these
functions to const that would fix this issue, but it still remains.
Any ideas?