General information
Category:
COM/DCOM and OLE Automation
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only