Proposed change: case VT_BSTR: { char* szString = WideToAnsi( pVariant->n1.n2.n3.bstrVal ); hb_itemPutCLPtr( pItem, szString, WideCharToMultiByte( CP_ACP, 0, pVariant->n1.n2.n3.bstrVal, -1, NULL, 0, NULL, NULL ) ); break; }
best regards Antonio 2009/9/22 Antonio Linares <antonioharb...@gmail.com>: > Viktor, > > This code in olecore.c (hb_oleVariantToItem()) fails if the string has > embedded zeroes, as hb_itemPutCPtr() uses strlen() to calculate the > string length. > > case VT_BSTR: > { > char* szString = WideToAnsi( pVariant->n1.n2.n3.bstrVal ); > hb_itemPutCPtr( pItem, szString ); > break; > } > > case VT_BSTR | VT_BYREF: > { > char* szString = WideToAnsi( *pVariant->n1.n2.n3.pbstrVal ); > hb_itemPutCPtr( pItem, szString ); > break; > } > > We appreciate your comments, thanks > > best regards, > > Antonio > _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour