Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working with Safe Arrays?
Message
De
05/08/2004 11:04:57
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00930360
Message ID:
00931032
Vues:
22
Not sure how this works as the following statement will not compile:
  DIMENSION MyArray AS String
I had to set it as MyArray[10] AS String and then it compiled but was not getting back the results I wanted.

>Hi Gary,
>
>It's interesting info. Thank you.
>
>>A fellow I worked with a few years ago wrote a C++ COM object to test what was sent to it when we were fruitlessly trying to pass safearray's to COM servers from VFP6. Starting with VFP8, the following code works:
>>
>>COMServer = CreateObject('something.class')
>>DIMENSION MyArray as BYTE
>>MyArray = 1 && Works without this line too
>>COMARRAY(COMServer,10) && Pass by ref
>>COMServer.Method(@MyArray)
>>
>>The test object shows VT_ARRAY of VT_UI1 VT_BYREF
>>
>>If I leave off the "as BYTE", I get VT_ARRAY of VT_VARIANT VT_BYREF
>>
>>If I use:
>>DIMENSION MyArray as STRING
>>MyArray = 'A'
>>I get VT_ARRAY of VT_BSTR VT_BYREF
>>
>>The "as" clause seems to make a difference.
>>
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform