You shouldn't use Marshal.SizeOf() for this operation. I assume that Paul
is trying to read managed types from the file. Marshal.SizeOf() will give
you the unmanaged size which may not be equal to
managed size.
--
Jared Parsons [MSFT]
ja******@online.microsoft.com
This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
"Pieter Philippaerts" <Pi****@nospam.mentalis.org> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
"Paul" <no*****************@i-stat.com> wrote The documentation says the
sizeof() is only supported in unsafe mode. Is there any equivalent to
sizeof() that I can use in managed code?
Try the Marshal.SizeOf() method (from the System.Runtime.InteropServices
namespace).
Regards,
Pieter Philippaerts