开发者

How can I use a void pointer as a parameter, of a function, in C#?

开发者 https://www.devze.com 2023-01-03 18:24 出处:网络
How can I use a void point开发者_如何学JAVAer as a parameter, of a function, in C#?Provided your C function looks like this:

How can I use a void point开发者_如何学JAVAer as a parameter, of a function, in C#?


Provided your C function looks like this:

int Foo(void* p, DWORD dwVal);

and you just rewriting it in C# then for most of the time all you need is something like this:

int Foo(object obj, uint val);

But if you are doing Interops then use P/Invoke as suggested above. A good place to start in this case is http://www.pinvoke.net/

0

精彩评论

暂无评论...
验证码 换一张
取 消