python加载windows COM-in

2024-05-20 02:03:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我注册了一个C#COM接口dll 使用 “c:\Windows\微软.NET\框架\v4.0.30319\RegAsm.exe“/代码基StepsToEveConverter.dll在

Microsoft.NET Framework程序集注册实用程序版本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

我已经安装了python 当我打字时python.exe在命令提示符下显示:

^{pr2}$

我的Eclipse工具中的pyhon路径 enter image description here

测试我使用的COM功能

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

谁会按预期打开单词

但是当我尝试使用我的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香港经济学院班我有参赛资格 enter image description here


Tags: tocomyournet版权所有withassemblyframework