python - How to fix Typelib generated by MIDL? -
i trying generate typelib of inetcfg interface using idl in page, seen below:
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; };
unfortunately, generated idl still can't loaded comtype, code given below:
import comtypes.client cc cc.getmodule("c:\path\to\netcfg.tlb")
it gives error windowserror: [error -2147312566] error loading type library/dll
how fix error? using windows 7 64 bit, , python 27 64
as use windows 7 64bit, solved issue, first running wdk setenv.bat <path_to_wdk> x64
. after that, generate typelib either using midl netcfg.idl /env x64
(for 64bit tlb) or midl netcfg.idl
(for 32bit tlb).
i opted use generate 64bit tlb
hope helps in touch com beast!
Comments
Post a Comment