02-27-2013 08:37 AM - edited 02-27-2013 08:39 AM
Hi TestStand Users, maybe somebody already had this issue and may help me 😉
I'm trying to get an unsigned char array out of my dll...
my function looks like that:
typedef unsigned char _U_BYTE; /* 8 bit unsigned integer data type */
typedef unsigned long _U_DWORD; /* 32 bit unsigned integer data type */
_BOOL Function1( _U_DWORD *udwMCM, _U_DWORD *udwSCM, _U_BYTE *ubyINFSEL, _U_BYTE *aubyINFDATA[10], _U_BYTE *ubyEC ) {... gstorm_sCMD_0A_ACK_t *CMD_0A_ACK = (gstorm_sCMD_0A_ACK_t*)ReceiveItem->aubyTelegram; *udwMCM = _ean_fSwap4Byte(CMD_0A_ACK->udwMCM, _ean_Unknown); *udwSCM = _ean_fSwap4Byte(CMD_0A_ACK->udwSCM, _ean_Unknown); *aubyINFDATA = CMD_0A_ACK->aubyINFDATA; *ubyINFSEL = CMD_0A_ACK->ubyINFSEL; *ubyEC = gstorm_eEC_No_Error }
my IDL:
[entry("")] _BOOL Function1( [in, out] _U_DWORD *udwMCM, [in, out] _U_DWORD *udwSCM, [in, out] gstorm_eINFSEL_t *eINFSEL, [out] _U_BYTE *aubyINFDATA[10], [out] gstorm_eEC_t *eEC );
In Teststand brings up following Warning:
"...uses Types not recognized by TestStand"
"...aubyINFDATA is of an unsupported Type"
Do I have to use a different data type in the IDL? Like LPSTR for Strings (const char*)?
btw. : I am using VC++ and TestStand 2012
Solved! Go to Solution.
02-27-2013 11:22 AM
I'm not sure what the right thing to put in the type library is, but the call will work if you specify the parameter as an array of 1-byte integers in teststand. You could maybe make the data type of the parameter be the following, but you will lose the information about the number of elements and that it's really an array:
_U_BYTE **aubyINFDATA
02-27-2013 12:00 PM
Thx for the answer.
_U_BYTE **aubyINFDATA
still causes the same error.
Enough for today, next try tomorrow!
02-28-2013 05:42 AM
I have to think over my Programming skills!
It hit me like a hammer
*aubyINFDATA = CMD_0A_ACK->aubyINFDATA;
wont work for an array copy *damnidiot*
the solution:
memcpy(*aubyINFDATA,CMD_0A_ACK->aubyINFDATA,sizeof(aubyINFDATA));
also, I thought every Output in an IDL needs to be a Pointer.
Arrays doesn't 😉 , but if I wanted i could use
[out] _U_BYTE (*aubyINFDATA)[10]
but
[out] _U_BYTE aubyINFDATA[10]
works fine!
At least my fault!
Thanks for help anyway!
03-01-2013 08:24 AM
Hi,
thank you for posting the solution 🙂