2015-10-29 72 views
1

我註冊了一個C#COM DLL接口 使用 「C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ RegAsm.exe」/代碼庫StepsToEveConverter.dll蟒蛇加載窗口COM接口

微軟.NET框架程序集註冊實用程序版本4.0.30319.34209 對於Microsoft .NET Framework版本4.0.30319.34209 版權所有(C)Microsoft Corporation。版權所有。

RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be i 
talled on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re 
egister it. 
Types registered successfully 

我已經安裝蟒 當I型python.exe在命令提示它顯示:

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (Intel)] on win32 
Type "copyright", "credits" or "license()" for more information. 

在我的Eclipse工具 enter image description here

爲了測試COM功能我用pyhon路徑

w=win32com.client.Dispatch("Word.Application") 
w.Visible=1 

誰打開Word作爲預期

但是,當我嘗試使用我的COM DLL StepsToEveConverter.dll我得到

from comtypes.client import CreateObject 
eveConverter = CreateObject("StepsToEveConverter"); 

給出錯誤:

... 
     _ole32.CoCreateInstance(byref(clsid), punkouter, clsctx, byref(iid), byref(p)) 
     File "_ctypes/callproc.c", line 945, in GetResult 
    WindowsError: [Error -2147221164] Class not registered 

在REGEDIT.EXE HKEY_CLASSES_ROOT我有入口 enter image description here

回答

0

我安裝了32位版本的蟒蛇後,它可以與此

import comtypes 
import comtypes.client 
eveConverter = comtypes.client.CreateObject("StepsToEveConverter");