2015-10-29 73 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");