我正在尝试在此页面中使用 IDL 生成 INetCfg 接口的类型库,如下所示:
import "netcfgx.idl";
[
uuid(d99085ff-c5d7-4a4c-a987-91a513e268a9),
version(1.0),
helpstring("NetCfgX 1.0 Type Library")
]
library NetCFGLib
{
interface IEnumNetCfgBindingInterface;
interface IEnumNetCfgBindingPath;
interface IEnumNetCfgComponent;
interface INetCfg;
interface INetCfgProperties;
interface INetCfgLock;
interface INetCfgBindingInterface;
interface INetCfgBindingPath;
interface INetCfgComponentBindings;
interface INetCfgBindingPath;
interface INetCfgClass;
interface INetCfgComponent;
interface INetCfgIdentification;
interface INetCfgClassSetup;
};
不幸的是,生成的 IDL 仍然无法从 comtype 加载,代码如下:
import comtypes.client as cc
cc.GetModule("C:\path\to\netcfg.tlb")
它给出了这个错误WindowsError: [Error -2147312566] Error loading type library/DLL
如何修复此错误?我正在使用 Windows 7 64 位和 Python 27 64