>Hi All,
>Does anybody know if VFP7 can pass a SafeArray of bytes (VT_UI1) by reference to a COM server? ComArray() and CreateBinary() never could do it in 6 sp3. The only arrays passed by reference were arrays of variants. VFP6 can pass an array of bytes by value, but not by ref. This caused no end of grief for me on a contract a while back and fed into the VB faction in the department because we needed to talk to third party COM servers by passing SafeArrays by reference so the server could fill them with data and they choked on variant arrays. This led to the VB champions getting VFP eliminated for the serious COM work and generally undermined in the eyes of management. Any hope that this lame deficiency has been corrected?
>
>Test one:
>DIMENSION aTest[10]
>aTest[1] = ‘a’
>aTest[2] = ‘b’
>…
>aTest[10] = ‘j’
>
>ComArray() and @ affects the BY_REF, but not the variant.
>VT_ARRAY|VT_VARIANT||VT_BYREF
>
>
>Test 2:
>CreateBinary() and ComArray() give me the following with or without the @:
>VT_ARRAY|VT_UI1
>
>My initial experiments don’t look good. Anybody have any experience with this? Thanks.
>
I posted a FAQ entry some months back here on UT demonstrating code for creating SafeArrays of BSTRs - you could modify that as needed.