如何使用C#中的Arraylist值在C ++代码中初始化Uint8 * [英] How Do I Initialize A Uint8* In C++ Code With Values Of The Arraylist In C#
本文介绍了如何使用C#中的Arraylist值在C ++代码中初始化Uint8 *的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用这样的C ++代码
I am having C++ code like this
UINT8 *ptr;
extern __declspec(dllexport) void initialize_ptr(UINT8 *p_ptr)
{
ptr = p_ptr;
}
在我的C#代码中,我有一个填充了值的ArrayList。我想在C ++中设置ptr,指针指向值在ArrayList中,以便C ++代码将获取arraylist的每个单独的值并继续计算。
如何初始化指向精确内存的C ++指针在C#中arraylist的位置,以便C ++代码执行指针数据没有任何问题?
谢谢...
In my C# code, i am having an ArrayList with values filled in. I wanted to set the ptr in C++ with the pointer pointing to the values in the ArrayList so that the C++ code which will take each individual values of the arraylist and proceed with the calculation.
How can i initialize the C++ pointer to the exact memory location of the arraylist in C# so that C++ code executes with the pointer data without any problem ?
Thanks...
推荐答案
您可以在此处找到有用的信息:MSDN上的阵列默认封送处 [ ^ ]。
You may find useful info here: "Default Marshaling for Arrays" at MSDN[^].
这篇关于如何使用C#中的Arraylist值在C ++代码中初始化Uint8 *的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文