Re: Union of structs in C#
- From: "Jared Parsons [MSFT]" <jaredpar@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 8 Sep 2005 16:35:25 -0700
Try reading this and see if it helps.
http://blogs.msdn.com/jaredpar/archive/2005/05/13/417263.aspx
--
Jared Parsons [MSFT]
jaredpar@xxxxxxxxxxxxxxxxxxxx
http://blogs.msdn.com/jaredpar
"This posting is provided "AS IS" with no warranties, and confers no rights"
"bazooka" <bazooka.1v1h22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:bazooka.1v1h22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> How far is it possible to handle unmanaged C++ declarations of unions in
> C#?? A struct with a union is resolved with
> [StructLayout(LayoutKind.Explicit)] and [FieldOffset(pos)] but what
> about this one??
>
> typedef Byte Bits;
>
> typedef union
> {
> struct {
> Bits queue :4; /* Network interface message
> queue */
> Bits q_cmd :4; /* Network interface command
> with queue */
> Bits length :8; /* Length of the buffer to
> follow */
> } q; /* Queue option
> */
> struct {
> Byte cmd; /* Network interface command
> w/o queue */
> Byte length; /* Length of the buffer to
> follow */
> } noq; /* No queue option
> */
> } NI_Hdr;
>
> Is there a solution in C# managed code??
>
>
> --
> bazooka
> ------------------------------------------------------------------------
> bazooka's Profile: http://www.highdots.com/forums/m667
> View this thread: http://www.highdots.com/forums/t2912328
>
.
- References:
- Union of structs in C#
- From: bazooka
- Union of structs in C#
- Prev by Date: Interop - XP vs. 2003
- Next by Date: Use com objects or .NET remoting?
- Previous by thread: Re: Union of structs in C#
- Next by thread: VARIANT (automation type) in C#?
- Index(es):
Relevant Pages
|