将托管内存传递给"void **参数";在托管的C ++代码中 [英] passsing managed memory to "void** argument" in managed c++ code

查看:176
本文介绍了将托管内存传递给"void **参数";在托管的C ++代码中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个托管的c ++类,我使用的主要函数实现了void **参数. void **参数指向2d字节数组,每次调用后都会对其进行大量修改,但不幸的是,该函数经常被调用.

您建议在什么情况下传递可以由托管c ++函数直接修改的C#变量?

亲切的问候.
Ali

Hi
I have a manged c++ class which the main function I use implements a void** parameter. void** parameter points to a 2d array of bytes which is modified a lot after each function call and unfortunately the function is called frequently.

What scenario do you propose to pass a C# variable which can be directly modified by the managed c++ function?

Kind Regards.
Ali

推荐答案

如果将数组的地址传递给C ++类,则只要数组包含基本类型,它就可以直接访问数组中的信息.
If you pass the address of the array to the C++ class then it can directly access the information in the array, as long as the array contains basic types rather than C# class objects.


Ali Beirami写道:
Ali Beirami wrote:

您提出了什么方案...

What scenario do you propose ...



我什么都没提议.您有问题吗?



I don''t propose anything. Do you have a question?




我的意思是我不需要直接代码.是否有任何建议,如果是您的问题,您将如何处理?

预先感谢
Hi,

I mean I do not need direct code. Any suggestion that if it is your problem how would you approach it?

Thanks in advance


这篇关于将托管内存传递给"void **参数";在托管的C ++代码中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆