首页 > 解决方案 > How to marshal data from C# to C++ and return the result?

问题描述

I could not find any useful documentation about marshaling List List List of tuples, into Vector Vector Vector of pairs. I wrote some code, but i could not use it because it uses generics, is there any way to send data to C++ dll library and return them, using maybe references?

//C#
List<List<List<Tuple<SomeClassWithFloats, SomeClassWithFloats>>>> someTupleData = new List<List<List<Tuple<SomeClassWithFloats, SomeClassWithFloats>>>>();
SomeFunction(someTupleData, dataIntPtr);
//C++
extern "C" SOME_API void SomeFunction(const std::vector<std::vector<std::vector<std::pair<SomeClassWithFloats, SomeClassWithFloats>> > > & vertices, SomeStructWithVectors* data);

标签: c#c++marshalling

解决方案


推荐阅读