I have been trying to find a way to pass a std::vector from native C++ code into a static method in a C++/CLI managed class. I am new to C++ (non-managed) and so it is not surprising I have had no luck with this. What I would like is some pointers as to how a std:vector (of any type, but preferably double or int) can be converted to managed C++/CLI arrays and/or C# arrays. Perhaps this cannot be done since I only see examples to do the opposite (i.e. C# to native C++), for example see "convert System::array to std::vector". Below I summarise my abortive attempts.
I can pass a double vector such as
vector<vector<double> > dblvec
into a method defined in a native C++ class (where the class is in a C++/CLI project), but not into a method defined in a ref class (also in a C++/CLI project). The comiler complains that the method (in the ref class) does not exist (candidate function not accessible). I think this is something to do with vector > being foced to be a private variable (see for example C++ CLI error C3767: candidate function(s) not accessible).
Any help would be greatly appreciated.