python调用VS2005编译的动态库出现问题

soasyou 2013-03-22 04:39:59
各位大牛好,用python调用vs2005编译的动态库是遇到问题,描述如下:
python脚本:
def test_fun(a):
print "in test_fun windll mode"
hNet=windll.LoadLibrary("testdll.dll")
nret1=hNet.test_fun(a)
print "nret1="+str(nret1)
return

python中出现的错误说明为:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
test_fun(2)
File "D:\mywork\test\testpy\bin\pytest.py", line 47, in test_fun
hNet=windll.LoadLibrary("testdll.dll")
File "D:\Python27\lib\ctypes\__init__.py", line 443, in LoadLibrary
return self._dlltype(name)
File "D:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 1114] 动态链接库(DLL)

请各位python高手帮忙看看,该怎么解决?先谢谢了!!
...全文
163 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
angel_su 2013-03-24
  • 打赏
  • 举报
回复
用c调用看看,搞不好也不成,那就非关python的事...
zx119koko 2013-03-23
  • 打赏
  • 举报
回复
试试DLLMain返回1. 你现在返回的是0 ?

37,743

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

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