Is there a way to share an enum definition between native (unmanaged) C++ and (managed) C#?
I have the following enum used in completely unmanaged code:
I've had the same problem in the past and solved it using preprocessor definitions.
In your unmanaged code, inside a header that can also be included by your managed wrapper, place your enumeration items into a #define.
Then, in your managed and unmanaged enumeration definitions, use the same #define for both usages.
The movement of the enumerations between the managed and unmanaged world looks slightly nasty (basically a cast is needed), but to your caller in the unmanaged world, it'll look and feel fine.
Good luck,