I can't get the contents of an C++/CLI enum to show up in a C# project.
I can see inside a class I wrote, and even see the enum, but I can't see the enum values. So I can't use the thing on my C# side.
Any reason why contents of a C++/CLI enum wouldn't show up.
My C++/CLI project is compiled as mixed to reuse a C++ library.
And I'm using Visual Studio 2005.
Make sure you used enum class
to create a .NET-compatible enumeration, and not a native C++ enum
type.
Later versions of Visual C++ require public enum class
, to disambiguate from the enum class
contextual keyword which is part of C++11 (and therefore creates a native type).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.