Is it possible to set a field in a structure to be ignored by the
marshaler? I have a struct that needs to be self contained, but it
would require the use of fields extra fields to maintain it.
[StructLayout(LayoutKind.Sequential)]
public struct MyStruct
{
public int size;
public IntPtr ptr;
// global fields that cannot be marshaled:
private SomeOtherClass soc;
}
Is there a way to designate "soc" to be ignored, or to write a custom
marshaler that would do so? (i..e - 8 bytes would be marshaled, and
Marshal.Sizeof(soc) would return 8)
Mattias Sjögren - 06 Jun 2005 22:44 GMT
>Is it possible to set a field in a structure to be ignored by the
>marshaler?
No, except by making the field static.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.