求教C#调用c++ dll函数声明的问题

3m2u 2013-01-28 09:36:25
我知道在c#中一般通过dllimport引用其它dll中的函数。
但不知道一些类型如何在c#中申明。比如要传入的指针,传出的指针:


void* Init();
int Load(void *ptr, const char * szFileName);

如上的2个函数在c#中如何申明?


class xxclass
{
[ DllImport("xx.dll", EntryPoint = "Init", CharSet = CharSet.Auto)]
public static extern ??? Init();

[ DllImport("xx.dll", EntryPoint = "Load", CharSet = CharSet.Auto)],
public static extern int Load(??? ptr, byte[](???) szFileName);
}
...全文
83 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
试试Intptr

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧