代码拉取完成,页面将自动刷新
package dmsoft
import (
"syscall"
"unsafe"
ole "github.com/go-ole/go-ole"
"github.com/go-ole/go-ole/oleutil"
)
var (
dmReg32 = syscall.NewLazyDLL("DmReg.dll")
_SetDllPathA = dmReg32.NewProc("SetDllPathA")
_SetDllPathW = dmReg32.NewProc("SetDllPathW")
)
type Dmsoft struct {
dm *ole.IDispatch
IUnknown *ole.IUnknown
}
func NewDmsoft() *Dmsoft {
var com Dmsoft
var err error
ole.CoInitialize(0)
com.IUnknown, err = oleutil.CreateObject("dm.dmsoft")
if err != nil {
panic(err)
}
com.dm, err = com.IUnknown.QueryInterface(ole.IID_IDispatch)
if err != nil {
panic(err)
}
return &com
}
// Release 释放
func (com *Dmsoft) Release() {
com.IUnknown.Release()
com.dm.Release()
ole.CoUninitialize()
}
// SetDllPathA Ascii
func SetDllPathA(path string, mode int) bool {
var _p0 *uint16
_p0, _ = syscall.UTF16PtrFromString(path)
ret, _, _ := _SetDllPathA.Call(uintptr(unsafe.Pointer(_p0)), uintptr(mode))
return ret != 0
}
// SetDllPathW Unicode
func SetDllPathW(path string, mode int) bool {
var _p0 *uint16
_p0, _ = syscall.UTF16PtrFromString(path)
ret, _, _ := _SetDllPathW.Call(uintptr(unsafe.Pointer(_p0)), uintptr(mode))
return ret != 0
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。