当我尝试在从 ObservableCollection 继承的托管 C++ 中创建一个类时,我收到错误:错误 C2039: 'ObservableCollection' : is not a member of 'System::Collections::ObjectModel'
这是我的代码:
using namespace System;
using namespace System::Collections;
using namespace System::Collections::Generic;
using namespace System::Collections::ObjectModel;
public ref class DataMatrix : public System::Collections::ObjectModel::ObservableCollection<array<Object^>^> {};
为什么我不能从 C++-CLI 使用这个类?我在 C# 中使用它没有任何困难。