开发者社区> 问答> 正文

这个错咋改腻,各位大神帮帮忙??报错

@Force武装卫队 你好,想跟你请教个问题:

 from ctypes import *
#加载API库
dll = windll.LoadLibrary( 'wdkmgr.dll' )
dll.EnumWdDevPath.argtypes=[c_ubyte,c_char_p]
DevNum=0
DevPath=c_char*32*128
nRst = dll.EnumWdDevPath(DevNum,DevPath)
Rst=c_bool(nRst) 

<p>
	</p><div>
		 报错 
	</div>
	<div>
		 Traceback (most recent call last):<br>

  File "D:\pyinstaller-2.0\pyinstaller-2.0\wxPython\DLL\WDKMGR 1.0.0.47\Debug\Instruction-Tool.py", line 10, in <module>
    nRst = dll.EnumWdDevPath(DevNum,DevPath)
ArgumentError: argument 2: <type 'exceptions.TypeError'>: wrong type 

展开
收起
爱吃鱼的程序员 2020-06-14 15:31:28 425 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    dll.EnumWdDevPath.argtypes=[c_ubyte,c_char_p]c_char_p只是char*而已。不一致了。

    回复 @测试小松鼠:好的回复 @Force武装卫队:明白了。勾了回复 @Force武装卫队:是不是选择那个对勾就行了呢?回复 @测试小松鼠:记得投票回复 @Force武装卫队:好哒。O(∩_∩)O谢谢啦
    2020-06-14 15:31:43
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载