Struct layout problem

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

    #1

    Struct layout problem

    I'm trying to write the definition of a struct that must exactly match
    the binary layout of a struct created by a native c++ program.

    The C++ struct contains several wchar_t[] and char[] fields containing
    text. So...

    a. How should I represent these field in the C# struct?
    b. How do I convert that representation into C# strings?

    Thanks for any help
    ++PLS
  • Chris Mullins [MVP - C#]

    #2
    Re: Struct layout problem

    Google has tons of articles on this exact topic.

    This one looks pretty good:


    --
    Chris Mullins

    "PLS" <nobody@nowhere .comwrote in message
    news:MPG.21942f 25fd63d7b99896b 2@msnews.micros oft.com...
    I'm trying to write the definition of a struct that must exactly match
    the binary layout of a struct created by a native c++ program.
    >
    The C++ struct contains several wchar_t[] and char[] fields containing
    text. So...
    >
    a. How should I represent these field in the C# struct?
    b. How do I convert that representation into C# strings?
    >
    Thanks for any help
    ++PLS

    Comment

    Working...