新的非托管的东西 - 导入一个期望无效的函数**? [英] New to unmanaged stuff - import a function that expects a void** ?

查看:49
本文介绍了新的非托管的东西 - 导入一个期望无效的函数**?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我对非托管和DllImport和其他东西都是新手,所以请解释一下我是你的爷爷! ^^


我如何使用此函数

 DWORD WINAPI Foo(_In_out_ void ** handle);  

提前致谢!

解决方案

我担心假设我们可以解释一些东西是不现实的合理地提前,不知道你在哪里。


您知道托管代码和非托管代码之间的区别吗?


你知道CLR如何管理内存吗?


你对C ++有多舒服?


指针和双指针怎么样?


你知道C ++代码中的void **是什么吗?


一般来说你对C#有多舒服?


你知道IntPtr用于什么吗?


如果你还没有很好地理解C#,我强烈建议你得到在尝试解决互操作代码之前先熟悉它。如果不了解C#以及CLR如何工作,那么对互操作的解释可能会毫无意义。对C ++有一个很好的理解也是一个好处,但对于进行互操作调用并不重要。


Since I am absolutely new to unmanaged and DllImport and stuff, please explain like I was your grandpa! ^^

How do I use this function

DWORD WINAPI Foo(_In_out_ void** handle);

from managed code?

Thanks in advance!

解决方案

I'm afraid it is unrealistic to assume we can explain something that is reasonably advanced without any knowledge of where you are at.

Do you know the difference between managed and unmanaged code?

Do you know how the CLR manages memory?

How comfortable are you with C++?

How about pointers and double pointers?

Do you know what void** is in C++ code?

How comfortable are you with C# in general?

Do you know what IntPtr is used for?

If you don't already have a good understanding of C# then I strongly recommend that you get comfortable with it first before you try to tackle interop code. Without an understanding of C# and how the CLR works then an explanation of the interop could would be meaningless. Having a good understanding of C++ would be a benefit as well but not critical to making interop calls.


这篇关于新的非托管的东西 - 导入一个期望无效的函数**?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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