Help with marshalling

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Farrell

    #1

    Help with marshalling

    Hi Everyone -

    I have two questions about MarshalAs



    1) I need to setup the correct MarshalAs for this setup...

    [StructLayout(La youtKind.Sequen tial)]
    public struct DateTimeStruct
    {
    public int year;
    public int month;
    public int day;
    public int hour;
    public int minute;
    public int second;
    }

    What would the correct MarshalAs statement be?

    This is what i'm trying...

    [MarshalAs( UnmanagedType.S truct)]
    DateTimeStruct startTime;


    2) Given this struct element -

    int samplingInterva l[5]

    What would the correct MarshalAs statement be?
    This is what i'm thinking...
    [MarshalAs( UnmanagedType.B yValArray, SizeConst=5)]
    int samplingInterva l;


    Would someone please correct my direction on these two questions??

    thanks
    tony
Working...