[Mono-list] Marshaling unmanaged structure

Javier Diaz javierdiazm at yahoo.com.mx
Mon Aug 29 02:13:59 EDT 2005


Hey all

I have an unmanaged structure that looks like this:

------------------------------
typedef struct event_struct {
  struct event_struct *next;
    int type;
    union {
       struct ev_levels  levels;
       struct ev_text text;
       struct ev_call_state call;
       struct ev_netstats  netstats;
       struct ev_url url;
       struct ev_video video;
       struct ev_registration reg;
    } ev;
} event;
------------------------------

I don't know how to wrap this structure, I know that the only posible
way us by using the attribute [StructLayout (LayoutKind.Explicit]]
and the attribute [FieldOffset (..)]

the structures that are inside the union are easy to wrap, they look like this:
------------------------------
struct iaxc_ev_levels {
  float input;
  float output;
};
------------------------------

Any ideas?

-

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 


More information about the Mono-list mailing list