参考C ++ / CLI项目,C ++ / CLI枚举没有显示在C#中 [英] C++/CLI enum not showing up in C# with reference to C++/CLI project
问题描述
我可以看到在我写的一个类中,甚至可以看到C ++ / CLI枚举的内容看到枚举,但我看不到枚举值。所以我不能使用我的C#方面的东西。
C ++ / CLI枚举的内容不会显示的任何原因。
我的C ++ / CLI项目被编译为混合以重用C ++库。
我使用的是Visual Studio 2005。 p>
确保您使用枚举类
来创建.NET兼容枚举,而不是本机C ++ 枚举
类型。
以后的Visual C ++版本需要 public枚举类
,从C ++ 11的一部分(因此创建本机类型)的枚举类
消除歧义。 p>
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).
这篇关于参考C ++ / CLI项目,C ++ / CLI枚举没有显示在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!