01-12-2011 03:44 PM
From within TestStand...
How do I declare a variable of type unsigned int* pPointerToThisArrayToFill[10] that can be passed to a C++ DLL function with the following prototype
as the variable in the BOLD seen below...
As in...
typedef int (CALLBACK* LPFNDLLFUNC2) (char ThePTPFileNameandPath[256],
int Protocoltype,
unsigned int FirstIDByte,
unsigned int SecondIDByte,
unsigned int** pArrayToFill,
unsigned int* The1stArraySizeDimension,
unsigned int* The2ndArraySizeDimension,
unsigned long* ComparisonCRCOfFilesData,
long int* LowestAddress,
long int* HighestAddress,
unsigned int* HowManyMessages,
unsigned int* TransferBlockCount
);
The rationale for this pointer array is so that I do not have to create a DLL function that utilizes a hard-code sized array
as in this older style shown below...IN BOLD The hard code must change if I have a need for a larger array as has occurred requiring
a dimension of [10][1024]...
typedef int (CALLBACK* LPFNDLLFUNC1) (char ThePTPFileNameandPath[256],
int Protocoltype,
unsigned int FirstIDByte,
unsigned int SecondIDByte,
unsigned int pArrayToFill[10][512],
unsigned long* ComparisonCRCOfFilesData,
long int* LowestAddress,
long int* HighestAddress,
unsigned int* HowManyMessages,
unsigned int* TransferBlockCount );
A higher degree of elegance and flexibility can be acheived if I can declare from within Teststand a variable of type
unsigned int* pPointerToThisArrayToFill[10] which points to unsigned int ThisArrayToFill[10][1024] through the for loop address connection...
//**************************************************************************************************
for(x = 0; x < 10; x++)
{
pPointerToThisArrayToFill[x] = ThisArrayToFill[x];
}
//**************************************************************************************************
This works in C++ how can I make it work from TestStand?
Thanks,
Mark W Laine
01-13-2011 10:38 AM
It looks like you are wanting to pass a parameter that is an array of arrays. I do not think the DLL adapter currently supports this. You can create a variable in TestStand that is kind of like an array of arrays by creating an array of containers and changing the type of each element to an array of Numbers, but you will need to access the data programmatically using the TestStand API as the DLL adapter does not know how to pass such a thing.
Hope this helps,
-Doug