09-26-2006 12:37 PM
09-26-2006 04:01 PM
Hi Rafi,
Here is some code to get your element of the string array.
#include "stdtst.h"
#include "tsutil.h"
void __declspec(dllexport) GetStringFromArray(CAObjHandle propertyObject, char returnString[1024], short *errorOccurred, long *errorCode, char errorMsg[1024])
{
int error = 0;
ErrMsg errMsg = {"Error with GtValStringByOffset"};
ERRORINFO errorInfo;
//char *lastUserName = NULL;
char *str=NULL;
// INSERT YOUR SPECIFIC TEST CODE HERE
// The following code shows how to access a property or variable via the TestStand ActiveX API
tsErrChk (TS_PropertyGetValStringByOffset (propertyObject, &errorInfo, 3, 0,
&str));
strcpy(returnString, str);
Error:
// FREE RESOURCES
// if (lastUserName != NULL)
// CA_FreeMemory(str);
// If an error occurred, set the error flag to cause a run-time error in TestStand.
if (error < 0)
{
*errorOccurred = TRUE;
// OPTIONALLY SET THE ERROR CODE AND STRING
*errorCode = error;
strcpy(errorMsg, errMsg);
}
}
Added some attachments as well
Hope it helps
Regards
Ray Farmer