简单问题!dll的

renmiaoxin 2009-11-25 06:08:17
我要调用一个写好的dll
其中有一个函数是指针传递的。我不知怎么写了啊?
[DllImport("8940A1.dll")]

private static extern int pmove(int cardno,int axis,long pulse);
private static extern int get_command_pos(int cardno, int axis, long *pos);

就是这个pos 在C里是个long的指针。在这呢?什么是委托?我看别人都说委托!
谢谢大家,在线等!!
...全文
138 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
renmiaoxin 2009-11-26
  • 打赏
  • 举报
回复
谢谢大家我会啦!ref
renmiaoxin 2009-11-26
  • 打赏
  • 举报
回复
啊?longptr
找不到类型或命名空间名称“LongPtr”(是否缺少 using 指令或程序集引用?)
是不是程序头的using啊?写什么呢?
我很菜,大家帮忙!
烈火蜓蜻 2009-11-26
  • 打赏
  • 举报
回复
private static extern int get_command_pos(int cardno, int axis, LongPtr pos);
naive1010 2009-11-26
  • 打赏
  • 举报
回复
还用IntPtr是可以的
starj1 2009-11-26
  • 打赏
  • 举报
回复
LZ,你要什么指针呢?如果是API调用的话会需要用到指针。大部分情况下不需要。
你可以试下ref这个关键字。
fengling2001 2009-11-26
  • 打赏
  • 举报
回复
IntPtr 或者 ref int都可以
zdhook 2009-11-26
  • 打赏
  • 举报
回复
ref int 对应于Win32的long指针
renmiaoxin 2009-11-25
  • 打赏
  • 举报
回复
那long呢?是不是不一样呢,能再说说吗?
wuyq11 2009-11-25
  • 打赏
  • 举报
回复
C++ C#
char* string
传出的char* StringBuilder
short short
char byte
char[n] fixed byte[n]
结构指针 结构指针
函数指针 委托
http://topic.csdn.net/u/20090225/15/a6bc50ad-9721-4749-b189-dc4a4bc045a1.html
renmiaoxin 2009-11-25
  • 打赏
  • 举报
回复
我急啊!没人帮帮?
renmiaoxin 2009-11-25
  • 打赏
  • 举报
回复
什么意思啊?我一点也不懂啊。请说明白点吧
hhc123 2009-11-25
  • 打赏
  • 举报
回复
IntPtr 表示指针类型

111,120

社区成员

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

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

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