我需要用 c++/cli 中的另一个列表填充集合,所以当我尝试这样做时出现错误的问题
错误 C2664: 'SpaceClaim::Api::V10::InteractionContext::Selection::set' : 无法将参数 1 从 'System::Collections::Generic::ICollection ^' 转换为 'System::Collections::Generic: :ICollection ^'
这里是代码
List<DesignEdge^> ^newEdges = gcnew List<DesignEdge^>();
for each (DesignEdge^edge in onecopiedBody->Edges)
{
if (!edges->Contains(edge))
{
newEdges->Add(edge);
}
}
cstom->InteractionContext->Selection = safe_cast<ICollection<IDesignEdge^> ^>(newEdges); //error here