不能从另一个项目中使用dll中的一个类的类型定义
Cant use typedef of one class in dll from another project
我写了一个dll,其中我有namespace VT
在witch class public ref class Database
在witch我有typedefs:
public:
typedef System::Collections::Generic::Dictionary <System::String^, Database^> SubkeyDictionary;
typedef System::Collections::Generic::Dictionary <System::String^, System::Object^> ValueDictionary;
typedef System::Collections::Generic::KeyValuePair <System::String^, Database^> SubkeyKeyValuePair;
typedef System::Collections::Generic::KeyValuePair <System::String^, System::Object^> ValueKeyValuePair;
当我将我的dll添加到另一个项目并写VT::我看不到我的类型,为什么?
一个类型集更像是一个别名,而不是一个实际的类型,我将很快检查,但我怀疑这不是作为一个可以从其他程序集使用的。net类型公开的。
然而,并不是所有的都输了。除了使用排版,您还可以执行以下操作
public:
ref class SubkeyDictionary : public System::Collections::Generic::Dictionary <System::String^, Database^> {};
....
类型定义在类中,而不是名称空间中。写
VT::Database::
相关文章:
- 此代码是否违反一个定义规则
- 静态结构和一个定义规则
- 为什么转换函数声明不需要至少一个定义类型说明符
- 只有一个定义/声明时标头声明变量的多堆定义错误
- 一个定义规则 - 编译
- 为什么传递给函数 set::itrator 而不是 const_iterator 违反了一个定义规则?
- 内联函数和一个定义规则
- 如何在C 中应用ODR(一个定义规则)
- C++ 多个定义,即使只给出了一个定义
- std::integral_constant<T, v>::value 总是有一个定义吗?
- 为什么这不违反一个定义规则
- C 是纯虚拟函数,也是一个定义或仅声明
- 从标准库重新定义函数是否违反了一个定义规则
- 是否使用“ __Date__”或“ __Time__”违反了一个定义规则
- 非静态数据成员和一个定义规则
- 如何在C++中声明一个定义为func(cv::Mat &img)的函数
- 现代C和C :可以将一个定义的结构用于其他声明的结构
- C 是平行阵列一个定义的结构
- 当一个定义位于命名空间中时不明确的函数调用
- C++:同名的文件范围常量违反了一个定义规则