Hello EngMax,
Since your 2dArray is defined just as a pointer to a double, you can try to access the element you want by indexing your array like so:
To get array[i][j] where i is the row and j is the column, in psuedocode, you would something like
Array2D[(i * (length of each row) + j)].
Also, the CA_Get2DArrayElement function, as mentioned in function help is a macro.
The function help for VariantGet2DArray mentions how to use this macro:
double * dblArray = NULL;
VARIANT variant;
unsigned numElemsDim1, numElemsDim2;
int index1, index2;
/* Call an ActiveX function that returns a safe array in a Variant. */
.
.
.
/* Convert the safe array the variant contains into a C-style array. */
HRESULT CA_VariantGet2DArray(&variant, CAVT_DOUBLE, &dblArray, &numElemsDim1, &numElemsDim2);
for (index1 = 0; index1 < numElemsDim1; index1++)
for (index2 = 0; index2 < numElemsDim2; index2++)
{
double d;
d = CA_Get2DArrayElement(dblArray, numElemsDim1, numElemsDim2, index1, index2, double);
printf("%f", d);
}
/* Free the allocated array. */
CA_FreeMemory(dblArray);
Hope that helps.
Wendy L
LabWindows/CVI Developer Newsletter