[英]Com server build using Python on 64-bit Windows 7 machine
原帖如下: http : //mail.python.org/pipermail/python-win32/2010-December/011011.html
我在用:
- 操作系统:64位Windows 7专业版
- Python:python-2.7.1.amd64
- Python win32扩展:pywin32-214.win-amd64-py2.7
- Py2exe:py2exe-0.6.9.win64-py2.7.amd64
我正在尝试为Windows构建图标叠加层。 它在32位Windows上运行良好,但在64位Windows 7上运行不正常。
以下是我为测试创建的Python模块:
test_icon_overlay.py:( http://mail.python.org/pipermail/python-win32/attachments/20101229/bb8c78a4/attachment-0002.obj的Python为图标叠加创建)COM服务器这增加了复选标记图标覆盖(C: \\ icons \\ test.ico)在“C:\\ icons”文件夹中
setup_VI.py:( http://mail.python.org/pipermail/python-win32/attachments/20101229/bb8c78a4/attachment-0003.obj其分配创建test_icon_overlay.dll)安装文件。
当我在Windows命令提示符下执行python test_icon_overlay.py
并重新启动explorer.exe
时,图标覆盖显示在C:\\icons
文件夹中。 但它不能使用setup_VI.py
创建的dll文件
我使用python setup_VI.py py2exe
创建了dll文件,然后尝试使用regsvr32 test_icon_overlay.dll
注册它。 Error 0x80040201 while registering shell extension
失败并显示Windows错误消息Error 0x80040201 while registering shell extension
。
然后我打开在记录Python27/Lib/site-packages/py2exe/boot_com_servers.py
这里是我得到的回溯comerror.txt
上regsvr32 test_icon_overlay.dll
PATH is ['C:\\root\\avalon\\module\\sync\\python\\src\\dist\\library.zip']
Traceback (most recent call last):
File "boot_com_servers.py", line 37, in <module>
pywintypes.error: (126, 'GetModuleFileName', 'The specified module could not
be found.')
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'DllRegisterServer' is not defined
看起来win32api.GetModuleFileName(sys.frozendllhandle)
或64位Windows 7上的dll构建可能存在问题。
另外,我看到在64位Windows 7上安装pywin32-214.win-amd64-py2.7
时出现错误消息: 快照
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
有什么我做错了吗? 对此的任何帮助都非常感谢。
64位Python上的py2exe存在一个错误。 由py2exe初始化的sys.frozendllhandle无效,因此win32api.GetModuleFileName(sys.frozendllhandle)失败。
您可能想在http://www.lfd.uci.edu/~gohlke/pythonlibs/#py2exe上尝试修补的py2exe安装程序
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.