D
Delali Dzirasa
I would have a number packed with its hex representation of the integer
below is some sample code of what is being done.
int value = 20; //in hex it is 0x14
AddData (value);
..
..
..
AddData( USHORT myVal.....)
{
UCHAR tmp2[2];
tmp2[1] = myVal & 0x00FF;
tmp2[0] = (myVal & 0xFF00) >> 8 ;
memcpy(&myPkt[0], &tmp2, 2); // (where myPkt is a UCHAR*
}
when I check the hex dump I see that 0x0020 was packed instead of the 0x0014
that I want. How can I set the proper flags(?) "if" that is the solution to
pack the hex representation of the integer?
Thanks, your help is greatly appreciated!
Delali
below is some sample code of what is being done.
int value = 20; //in hex it is 0x14
AddData (value);
..
..
..
AddData( USHORT myVal.....)
{
UCHAR tmp2[2];
tmp2[1] = myVal & 0x00FF;
tmp2[0] = (myVal & 0xFF00) >> 8 ;
memcpy(&myPkt[0], &tmp2, 2); // (where myPkt is a UCHAR*
}
when I check the hex dump I see that 0x0020 was packed instead of the 0x0014
that I want. How can I set the proper flags(?) "if" that is the solution to
pack the hex representation of the integer?
Thanks, your help is greatly appreciated!
Delali