Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
rename ocr to text
  • Loading branch information
nb857 committed Jan 26, 2022
1 parent a2e433a commit 1a687e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package gdm

import (
"fmt"
"github.com/pkg/errors"
"syscall"
"unsafe"
Expand All @@ -25,13 +26,13 @@ type DmSoft struct {
}

// New return *DmSoft.DmSoft
func New(dllPath string) (dm *DmSoft, err error) {
dmReg32 = syscall.NewLazyDLL(dllPath + `\DmReg.dll`)
func New(dllPath, dllReg, dllDm string) (dm *DmSoft, err error) {
dmReg32 = syscall.NewLazyDLL(fmt.Sprintf(`%s\%s.dll`, dllPath, dllReg))

procSetDllPathA = dmReg32.NewProc("SetDllPathA")
procSetDllPathW = dmReg32.NewProc("SetDllPathW")

if !SetDllPathW(dllPath+`\dm.dll`, 1) {
if !SetDllPathW(fmt.Sprintf(`%s\%s.dll`, dllPath, dllDm), 1) {
return nil, errors.New("load dm.dll failed")
}

Expand Down

0 comments on commit 1a687e5

Please sign in to comment.