Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working with Safe Arrays?
Message
 
 
À
05/08/2004 13:01:23
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00930360
Message ID:
00931087
Vues:
20
Gary,


How do you pass a date in this scenario?

>BTW, just to continue a thread almost no one in the VFP community cares about<g>, CreateBinary() will create a string that can be passed as a safearray of VT_UI1 as in cStr = CreateBinary('123456578'), but cStr cannot be passed BY_REF even using ComArray(oComObject,10). Only by first creating an array as byte and filling it can we pass by reference as some COM servers require for passing data back and forth.
>
>Maybe this obscure info will save someone some grief sometime.
>
>Disclaimer: Since I didn't write the COM data thingy, I don't know exactly what it's doing under the covers, but it seems to work, e.g., passing a date returns VT_DATE, 1234 returns VT_I4, etc.
>
>ComArray(oComObj,10)
>DIMENSION MyArray[5] as BYTE
>MyArray[1] = '1'
>MyArray[2] = '2'
>MyArray[3] = '3'
>MyArray[4] = '4'
>MyArray[5] = '5'
>MyStr = CreateBinary('12345')
>
>oComObj(MyStr) && VT_ARRAY|VT_UI1
>oComObj(@MyStr) && VT_ARRAY|VT_UI1
>oComObj(MyArray) && VT_ARRAY|VT_UI1- still seen as array even w/o the @
>oComObj(@MyArray) && VT_ARRAY|VT_UI1|BY_REF
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform