簡體   English   中英

在64位Windows 7計算機上使用Python構建Com服務器

[英]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模塊:

  1. 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”文件夾中

  2. setup_VI.py:( http://mail.python.org/pipermail/python-win32/attachments/20101229/bb8c78a4/attachment-0003.obj其分配創建test_icon_overlay.dll)安裝文件。

  3. icons.zip :( http://mail.python.org/pipermail/python-win32/attachments/20101229/bb8c78a4/attachment-0001.zip )進行測試你應該在C:中提取icons.zip

當我在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.txtregsvr32 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM