首页 > 技术文章 > python 免注册调用dm

yubs 2019-11-06 19:17 原文

因为需要使用大漠插件

注册com组件能调用,但是免注册的没找到资料,故折腾了一番

#注册大漠插件
import win32com.client
dm = win32com.client.Dispatch('dm.dmsoft')
print(dm.Ver())

# 免注册大漠插件
import ctypes
from comtypes.client import CreateObject
dms = ctypes.windll.LoadLibrary(r'DmReg.dll')
dms.SetDllPathW(r'dm.dll', 0)
dm = CreateObject('dm.dmsoft')
print(dm.Ver())

 

 

推荐阅读