c# - 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);
解决方案
推荐阅读
- azure-devops - 有没有办法自定义我在 Microsoft Teams 中收到的通知?
- reactjs - 如何有条件地呈现状态属性
- mysql - 使用 auto_incremented 列中的数字作为插入值的 SQL 插入查询
- scala - 使用 Scala 的 HttpPost
- c - 卡在一个奇怪的循环中,没有文件
- python - 气流:添加python依赖项时出错
- python-3.x - requests-html 和无限滚动
- pip - pypi安装后pip安装上的importerror
- java - 如何在不安装 R 的情况下在 Java 中加载 R 脚本?
- xslt - 使用 XLST 复制/粘贴前面元素的值