Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access VFP COM array property from VB
Message
From
09/10/1999 11:02:09
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00274505
Message ID:
00274600
Views:
33
In VB arrays are Zero Based... try accessing element [1,1] in VFP as [0,0] in VB.

BOb


>I'm having problems accessing a VFP COM array property from VB. Below is my small sample code:
>
>[VFP COM Server GetData method code]:
>THIS.aData[1,1] = 'TESTING 123'
>THIS.cData = THIS.aData[1,1]
>
>[VFP Client code:] This works!
>oComObject = CREATEOBJECT("VFPServer.GetData")
>oComObject.GetData
>? oComObject.aData[1,1]
>
>[VB Client code:]
>Dim varData,varData2 As Variant
>Dim oVFPServer As New GetData
>oVFPServer.GetData
>'this work
>varData = oVFPServer.cData
>'this doesn't work
>varData2 = oVFPServer.aData[1,1]
>
>The last line generates "Type mismatch error". Has anyone been able to successfully work with array (passing or accessing) between VFP and VB?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform