#1 Variant PB

open
nobody
None
5
2005-09-15
2005-09-15
No

I found problem in VARIANT.cpp.
This is the patch to fix my problem.

diff -c cpp/VARIANT.cpp.old cpp/VARIANT.cpp
*** cpp/VARIANT.cpp.old Mon May 31 02:32:52 2004
--- cpp/VARIANT.cpp Thu Sep 15 11:37:49 2005
***************
*** 218,226 ****
jclass clsStringArray =
env->FindClass("[Ljava/lang/String;");
if(env->IsInstanceOf(obj, clsStringArray)) {
jobject val =
env->GetObjectArrayElement((jobjectArray)obj, 0);
! BSTR bstrVal = jstring2BSTR(env, (jstring)val);
var->vt = VT_BSTR|VT_BYREF;
! var->pbstrVal = &bstrVal;
return 0; // 正常終了
}

--- 218,227 ----
jclass clsStringArray =
env->FindClass("[Ljava/lang/String;");
if(env->IsInstanceOf(obj, clsStringArray)) {
jobject val =
env->GetObjectArrayElement((jobjectArray)obj, 0);
! BSTR *pbstrVal = (BSTR *)malloc(sizeof(BSTR));
! *pbstrVal = jstring2BSTR(env, (jstring)val);
var->vt = VT_BSTR|VT_BYREF;
! var->pbstrVal = pbstrVal;
return 0; // 正常終了
}

***************
*** 258,263 ****
--- 259,265 ----
break;
case VT_BSTR|VT_BYREF:
SysFreeString(*var->pbstrVal);
+ free(var->pbstrVal);
break;
default:
break;

Thanks

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks