When creating a C# representation of a native C structure,
do you think
its a good idea to embed constants inside that structure?
Like for some
Windows API functions you need to pass structures as
arguments, and for
some ODD reason those structures have members that denote
the size of
the structure itself (for instance WNDCLASSEX). So my real
question is
that when you re-create those structures in C# can you just
add a
constant member to it that already holds the size of
structure?
Example:
public struct WNDCLASSEX {
...
public const int Size =
Marshal.SizeOf(WNDCLASSEX.GetType());
}
P.S> I'm sorry I'm really bad at wording my questions,
but if someone
could help me out with this, I'd be REALLY thankful.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharp googlegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribe googlegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---
|