locked
Marshall::ReadByte issue RRS feed

  • Question

  • This is how i am using this function.  the way that i understand it is that the next 2 bytes make up an integer, how do i put that together to make the integer?  the memory dump location for pIn looks like this in hex 0x01451f44

    Byte by = Marshal::ReadByte(pIn);

    Convert::ToString(Int32((int)by));

    Friday, January 6, 2006 10:20 PM

Answers

  • Would it be easier to read integer with ReadInt32()?

    http://msdn2.microsoft.com/en-us/library/84ctdyxz(en-US,VS.80).aspx

     

    Nikola

    Saturday, February 4, 2006 1:10 AM
  • i am not just reading integers in.  This would be great if i were reading only two bytes and they were always integers.  Unfortuately i have doubles, longs and floats to read in and they have different sizes from the integers, in bytes.  The ReadInt32 is not going to work.  I have something that works, but not be elegant.
    Monday, February 6, 2006 5:08 PM

All replies

  • Would it be easier to read integer with ReadInt32()?

    http://msdn2.microsoft.com/en-us/library/84ctdyxz(en-US,VS.80).aspx

     

    Nikola

    Saturday, February 4, 2006 1:10 AM
  • i am not just reading integers in.  This would be great if i were reading only two bytes and they were always integers.  Unfortuately i have doubles, longs and floats to read in and they have different sizes from the integers, in bytes.  The ReadInt32 is not going to work.  I have something that works, but not be elegant.
    Monday, February 6, 2006 5:08 PM