How to pass an array of single values to a message?



Hi

I have an ActiveX control and one of its methods take in a parameter of
array of single values.
The vendor of the ActiveX control has some sample of using the control.
However these sample code is in VB and Visual C++.

Below are the sample codes:

*************************************************
** VB code **
Dim sngLayout(4) As Single
sngLayout(0) = 0
sngLayout(1) = 0
sngLayout(2) = 200
sngLayout(3) = 300
ImgScan1.SetScanCapability 106, sngLayout
*************************************************


*************************************************
** VC++ code **
VARIANT sngLayout[4];
V_VT(&sngLayout[0]) = VT_R4;
V_VT(&sngLayout[1]) = VT_R4;
V_VT(&sngLayout[2]) = VT_R4;
V_VT(&sngLayout[3]) = VT_R4;
V_R4(&sngLayout[0]) = 0;
V_R4(&sngLayout[1]) = 0;
V_R4(&sngLayout[2]) = 200;
V_R4(&sngLayout[3]) = 300;
COleSafeArray sa;
sa.CreateOneDim(VT_R4,4,&sngLayout);
ImgScan1.SetScanCapability (106, sa);
************************************************

I have problem how to pass the array of single values to the method in VFP
8.
Does anyone know how to do it?

Appreciate your help.
Tham









.



Relevant Pages

  • Re: how to use SafeArrayCreate API in VFP?
    ... I have a activex control and one of its method require an array of ... There is some sample code to use the method but it is in VB and VC++. ... Do you know how to convert the VC++ syntax to VFP syntax? ...
    (microsoft.public.fox.programmer.exchange)
  • Re: How to pass an array of single values to a message?
    ... The OleControl prompt "data is not the correct type". ... I suspect the error is caused by the data type in the array. ... The vendor of the ActiveX control has some sample of using the control. ... However these sample code is in VB and Visual C++. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: ActiveX c# Array
    ... | method to the ActiveX control which I can call from the c# code to pass ... | the array. ... HRESULT PassDoubleArray([in] SAFEARRAY(double) arr); ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Hex data out com port using mscomm
    ... The trick to getting the MSComm32.OCX ActiveX control to send and ... Array" and when you send data out the port you need to set the Output ... If you are writing code in MFC then you could also incorporate the ...
    (microsoft.public.vc.mfc)
  • How to convert a byte array from ActiveX control to an Array object
    ... In my javascript, an ActiveX control returns a byte array, say block. ... var test = block; ... Is there anyone successed in getting a byte array from an ActiveX control? ...
    (comp.lang.java.programmer)