Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我遇到了一个“ref”关键字,该关键字应用于 .cpp 文件中的类。我想访问一个标记为 __clrcall 的方法。你能告诉我在视觉 C++ 代码中使用了什么 ref 关键字吗?
来自 MSDN:
一个 ref 类或 ref struct 可以从零个或多个托管接口和零个或一个 ref 类型继承。值类或值结构只能从零个或多个托管接口继承。
关联
“short short”版本是“ref class”是托管类。在未声明为“ref”的类中不能有托管类型的成员变量(.NET 库对象,如 StringBuilder 或 TCPListener)——也就是说,非托管类不能包含托管对象。