C
colin
Hi,
well ive written some code wich iterates through all the fields in
my data structures wich I need to format to/from a file
(wich has a complicated format)
and I can identify some simple structures that are packed and sequenctial
that I can
just binary copy the whole structure,
however I cant figure out how to get round the problems imposed in c#:-
I pass the structure to the function as an object ref,
but i cant then take the address of an object as it complains,
so I cant just simply copy it with pointers in an unsafe+fixed code section.
but when I use the marsheling services such as
Masrhal.PtrToStructure(fileSourceIntPtr,destObj)
it complains that it cant do this on destObj as it is a value type.
it wont let me pass it as a ref either.
it all seems to work ok for clases but that is too much of a limitation.
so is there any way to get the binary data from a file
copied into a packed struct when you only have a object ref to it ?
ive been looking for ages at the marshelling stuff and ive started to get
crossed eyes lol
thanks
Colin =^.^=
well ive written some code wich iterates through all the fields in
my data structures wich I need to format to/from a file
(wich has a complicated format)
and I can identify some simple structures that are packed and sequenctial
that I can
just binary copy the whole structure,
however I cant figure out how to get round the problems imposed in c#:-
I pass the structure to the function as an object ref,
but i cant then take the address of an object as it complains,
so I cant just simply copy it with pointers in an unsafe+fixed code section.
but when I use the marsheling services such as
Masrhal.PtrToStructure(fileSourceIntPtr,destObj)
it complains that it cant do this on destObj as it is a value type.
it wont let me pass it as a ref either.
it all seems to work ok for clases but that is too much of a limitation.
so is there any way to get the binary data from a file
copied into a packed struct when you only have a object ref to it ?
ive been looking for ages at the marshelling stuff and ive started to get
crossed eyes lol
thanks
Colin =^.^=