Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX question

Status
Not open for further replies.

jjgraf

Programmer
Joined
Aug 19, 2001
Messages
237
Location
US
I'm trying to write an app in VFP 7.0 sp1 that makes calles to National Instrustments (NI) ActiveX objects.

NI ActiveX objects are methods to query data from Lab Testing Equipment Hardware

I have been able to make calles and aquire data from the object but the return data is suppose to be in an 2D Array instead i'm only getting one value returned.

Now how do I pass Arrays by reference back and forth from ActiveX objects?

because when i do something like this
------------------------------------------------------
AmountOfData = 1000
deminsion ReturnData(1)

myobject.read(AmountofData, @ReturnData)
---------------------------------------------------
i get data type mismatch

now in VB the code looks like this
----------------------------------------------------
Dim AcqData
dim AmountofData
amountofdata = 1000

myobject.Read AmountofData, AcqData
---------------------------------------------------

and the AcqData becomes an array

so how do i work around this in VFP
 
At the time of initialization:

diminsion ReturnData(1)

ReturnData(1) will contain the value: .F.

You need to add something like

ReturnData(1) = ""

Dave S.
 
that did not work but i tryed this instead

set udfparams to reference

and it started to work

Dave That was my first try also but still got an error on data type mismatch. I tryed seting equal to every known data type to no success. But reset the udfparams to reference it worked go fig.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top