c ++ array of unsigned char dll

Hi TestStand users, maybe someone already had this problem and can help me ;-)

I'm trying to get an unsigned char out of my dll table...

my function looks like this:

typedef unsigned char _U_BYTE;    / * 8-bit unsigned integer data type * /.

typedef unsigned long _U_DWORD;    / * 32 bits 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 the following warning:

«.. . using types not recognized by TestStand.

«.. . aubyINFDATA is a type not supported. "

Do I have to use a different data type in IDL? As a LPSTR for strings (const char *)?

BTW. : I'm using VC ++ and TestStand 2012

I think about my programming skills!

It hit me like a hammer

*aubyINFDATA = CMD_0A_ACK->aubyINFDATA;

won't work for a copy of the table * damnidiot *.

the solution:

memcpy(*aubyINFDATA,CMD_0A_ACK->aubyINFDATA,sizeof(aubyINFDATA));

also, I thought that each output in an IDL must be a pointer.

The tables don't ;-), but if I wanted to I could use

[out] _U_BYTE (*aubyINFDATA)[10]

but

[out] _U_BYTE aubyINFDATA [10]

works great!

At least my fault!

Thanks for the help anyway!

Tags: NI Software

Similar Questions

Maybe you are looking for