找回密码
 加入
搜索
查看: 4206|回复: 7

[系统综合] DllCall如何传递指向指针的指针char**参数?

  [复制链接]
发表于 2012-11-27 18:13:43 | 显示全部楼层 |阅读模式
DLL里面的函数如
int WriteFile(char** fileName )

使用的参数是指向指针的指针,请问DllCall如何传递指向指针的指针char**参数?

我使用了DllStructCreate 和DllStructGetPtr,但是还是不行。请问哪位大神有示例或知道这个该怎么传?非常感谢!!!

$FNStruct = DllStructCreate("char fns[128];")
DllStructSetData($FNStruct, "fns", "test123456")

DllCall($dll, "int:cdecl","WriteFile", "ptr", DllStructGetPtr($FNStruct))
 楼主| 发表于 2012-11-27 18:14:34 | 显示全部楼层
在线等大神回答,谢谢!!!
 楼主| 发表于 2012-11-27 19:07:32 | 显示全部楼层
没人吗............................
发表于 2012-11-27 19:31:30 | 显示全部楼层
本帖最后由 edisonx 于 2012-11-27 19:32 编辑

試試這個吧


$s = DllStructCreate("ptr ppfname;ptr pfname;char  fname[200]") ; struct ptr { char fname[200])

; p1 = address of fname
$p1 = dllStructGetptr($s, 3) ;  p1 = address of fname
dllStructSetData($s, 2, $p1) ;  set "address of fname" to pfname

;p2 = address of p1
$p2 = DllStructGetPtr($s, 2)
dllStructSetData($s, 1, $p1)

ConsoleWrite("p1 = " & $p1 & @CRLF)
ConsoleWrite("p2 = " & $p2 & @CRLF)

评分

参与人数 1金钱 +60 收起 理由
Joo + 60 哥,大恩不言谢!

查看全部评分

发表于 2012-11-27 21:10:10 | 显示全部楼层
 楼主| 发表于 2012-11-28 12:03:35 | 显示全部楼层
谢谢各位,我试试去~~~
发表于 2012-11-30 11:30:22 | 显示全部楼层
学习学习学习学习
发表于 2012-12-3 08:37:44 | 显示全部楼层
哇,我连楼主的主题都不懂
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-20 07:18 , Processed in 0.084250 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表