I am talking to a piece of equipment using ActiveX and the return type after querying for data is VARIANT. Now I try the command, "CA_VariantHasArray (data);" and it returns a 1. Then I ask for the type and it returns a 0x1070 which according to the documentation is an array of Variants. Now I figured that maybe this array held a bunch of variants that contained double data, but when I call the function, "CA_VariantGet1DArray (data, CAVT_VARIANT, dataArray, &numPts);" I only get a copy of the variant and when I try to perform operations on the new variant I get an error "Variant not initialized"
the code looks like this
AgilentPNA835x_IMeasurementgetData (measObj, NULL, AgilentPNA835xConst_
naCorrectedData,
AgilentPNA835xConst_naDataFormat_LogMag, data);
status=CA_VariantHasArray (data);
type = CA_VariantGetType (data);
status = CA_VariantGet1DArray (data, CAVT_VARIANT, dataArray, &numPts);
type = CA_VariantGetType (dataArray);
I guess I should also say that the numPts variable in the call to "CA_VariantGet1DArray" returns 101 which is what I expect because I am looking for 101 data points from the instrument.
I don't understand how I can get at the data being returned to me.