arraylist问题?(100)

L

lwluser

Unregistered / Unconfirmed
GUEST, unregistred user!
java代码:public static int snd_Data(ArrayList data).......................c++:mid = env->GetStaticMethodID( cls, "snd_Data", "(Ljava/util/ArrayList;)I");
if(mid !=0).............................已经找到这个函数,可是我该怎么调用呢? data参数该怎么传递?
 
L

lwluser

Unregistered / Unconfirmed
GUEST, unregistred user!
我在用c++调用java的class文件,在c++中我只能用env->CallStaticIntMethod去调用这个函数,像这样: status = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
if (status != JNI_ERR) { cls = env->FindClass("cn/gov/cwl/dtclient/DTService");
if (cls==0) { cout < <"c++: not found class!" < <endl;
jvm->DestroyJavaVM();
............. ............. ............. mid = env->GetStaticMethodID( cls, "GetData", "(Ljava/lang/String;)I");
if(mid !=0) { cout < <"c++: static method GetData found." < <endl;
square=-1;
jstring str;
str=(*env).NewStringUTF((const char*)snd);
ret = env->CallStaticIntMethod( cls, mid,str);
cout < <"c++: sendData return:" < < ret < < std::endl;
我不知道在C++中该怎么处理java的arraylist类型
 

Similar threads

回复
0
查看
790
不得闲
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
926
SUNSTONE的Delphi笔记
S
S
回复
0
查看
752
SUNSTONE的Delphi笔记
S
顶部