c#向c++ dll传递双数组
C# passing double array to C++ dll
我有一个数组初始化在c#代码;然后我将它传递给c++ dll,其中数组的每个单独条目将被重新分配新的值。然后将数组与新值一起返回给c#。我想知道
- 什么是最好的方式来传递数组从c#到c++ ?(c#中这个数组的数据结构)从c++中返回数组的最好方法是什么?(c++中该数组的数据结构)
我的代码不工作:
用c#private static double[] _statsArray = new double[4];
GetImageStats( ref _statsArray);
c++ dll中:
DllExportImageStatistics GetImageStats( double (&pSignalArray)[4])
谢谢你的建议;几行代码就会有很大帮助。
我认为应该是:
private static double[] _statsArray = new double[4];
GetImageStats(_statsArray); // Lose the ref
和
DllExportImageStatistics GetImageStats(double pSignalArray[4])
相关文章:
- 系统.将数组移交给c#中动态加载的c++DLL时发生AccessViolationException
- 如何在 c# 代码中通过引用调用时从 c++ dll 更新数组值?
- 如何将 C# 中的二维数组传递给C++ DLL?
- 从非托管 C# DLL 返回列表/数组
- 如何使函数返回数组?用于制作在VB.NET中使用的DLL
- 对需要双精度数组和结构作为输入C++ DLL 函数的 C# 调用
- 如何在 VBA/Excel 中创建字符串数组并将其发送到C++ DLL,以便可以在 DLL 中循环访问它
- 将字节数组从 DLL 返回到 C#C++
- C++ DLL 包装器 vb.net 传递字节数组的字节数组?
- 将动态分配的数组从C DLL返回到VBA
- 将字节数组从c 不受管理的dll传递到c#unity
- 将字节数组从 C# DLL 返回到C++应用程序
- 如何从DLL检索数组变量?(视觉C )
- 将字符串数组从fortran传递到C/C DLL,并获取具有更改值的数组
- 当参数之一是指针数组时,如何从C#调用C DLL
- 将字符串数组从C DLL返回到VBA(Excel)
- 将字节数组作为char*从C#传递到C++DLL
- 嵌入式mono:将数组从C#DLL返回/复制到C++
- 从 VB6 调用的 C++ DLL 函数中的输出数组参数
- 将可变长度字节数组从 C# 传递到非托管C++ dll