I have a native c++ class, lets say "probe". I need to add it to an arrayList. Add method of ArrayList is needed an Object^. So how can I convert it?
Don't use ArrayList
.
Don't use ArrayList
for managed objects, prefer one of the generic collections instead, such as List<T>
.
Don't use ArrayList
to hold native objects, instead use an STL container, such as std::vector
.
The only reason ArrayList
even exists is for backward compatibility with code written in .NET 1.x.