且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将C#转换为C ++以转换IntPtr

更新时间:2023-02-14 21:05:31

Hellexx,
也许会对您有所帮助: http://tangiblesoftwaresolutions.com/Product_Details/CSharp_to_CPlusPlus_Converter_Details.html
您可以使用从C ++到C#转换器的演示版进行一次最多2000行的文件夹转换和一次最多200行的代码段转换.
Hi Hellexx,
maybe it will help you : http://tangiblesoftwaresolutions.com/Product_Details/CSharp_to_CPlusPlus_Converter_Details.html
You can use the Demo Edition of C++ to C# Converter for folder conversions up to 2000 lines and code snippet conversions up to 200 lines at a time.


您是否尝试过GlobalAlloc()或GlobalHandle ()?
do you have tried GlobalAlloc() or GlobalHandle()?


IntPtr可以引用C ++的常规指针,无论它是什么:void *,int *,long *,float *,等等.
如果您要调用返回指针的C ++函数或需要引用的指针参数,请

您肯定像您编写的那样在C#代码中需要IntPtr.
IntPtr can refer to a conventional pointer of C++, whatever it is : void*, int*, long*, float*, so on.

If you are gonna call a C++ function which returns a pointer or need a referenced pointer parameter,

you surely needs IntPtr in your C# code like you wrote.