How to import void * C API into C#?

后端 未结 3 1040
孤独总比滥情好
孤独总比滥情好 2021-02-20 10:17

Given this C API declaration how would it be imported to C#?

int _stdcall z4ctyget(CITY_REC *, void *);

I\'ve been able to get this far:

<
3条回答
  •  清歌不尽
    2021-02-20 10:52

    You can also use void* if you mark your class as unsafe.

    It really depends on what the API is looking for in that parameter.

    You can add IntPtr or Object* to get past compiler, but you will still need to pass it the correct data when you call it.

提交回复
热议问题