R
Ronodev.Sen
i have a C# program that is sending data in a byte array through a
socket.
the VC++ application server receives data in teh following format....
typedef struct advice
{
header sHdr;
char Code[33];
char pn[11];
char State[4];
char szType[4];
char szTravelDate[9];
char szAmount[13];
char szMethod[7];
char CATID[16];
long lStan;
...
}
the weird part is that EVERY char array after lStan is missing 3
characters.
if i do a QUICKWATCH in VC++, i get the value of lStan as "1128415488".
converting this to a byte array , yields the bytes {0,65,66,67} - which
is the first 3 values of the field after lStan.(the field after lStan
has 'ABCDEF')
i CANT use any structures, marshalled or otherwise at the C# end ,
because my structure definitions come out of a XML Schema document.
conversion routine for the value in C#
int nData = int.Parse(strTempData);
//convert to Byte Array; this.bPvtData =
BitConverter.GetBytes(nData);
this converts 3652 into byte array = {68,14, 0 , 0}
something is evidently happening to this when it comes out of the
Socket ... either that or VC++ is not interpreting the size of the
'long' variable (which im passing as a Int32)
please help!
socket.
the VC++ application server receives data in teh following format....
typedef struct advice
{
header sHdr;
char Code[33];
char pn[11];
char State[4];
char szType[4];
char szTravelDate[9];
char szAmount[13];
char szMethod[7];
char CATID[16];
long lStan;
...
}
the weird part is that EVERY char array after lStan is missing 3
characters.
if i do a QUICKWATCH in VC++, i get the value of lStan as "1128415488".
converting this to a byte array , yields the bytes {0,65,66,67} - which
is the first 3 values of the field after lStan.(the field after lStan
has 'ABCDEF')
i CANT use any structures, marshalled or otherwise at the C# end ,
because my structure definitions come out of a XML Schema document.
conversion routine for the value in C#
int nData = int.Parse(strTempData);
//convert to Byte Array; this.bPvtData =
BitConverter.GetBytes(nData);
this converts 3652 into byte array = {68,14, 0 , 0}
something is evidently happening to this when it comes out of the
Socket ... either that or VC++ is not interpreting the size of the
'long' variable (which im passing as a Int32)
please help!