gonutz / wui

Windows GUI library for Go (Golang). Comes with a graphical UI designer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Got panic err when run design tool

isabst opened this issue · comments

platfrom: win10 x64

Failed to find SetClassLongPtrW procedure in user32.dll: The specified procedure could not be found

goroutine 1 [running, locked to thread]:
syscall.(*LazyProc).mustFind(...)
C:/go/src/syscall/dll_windows.go:320
syscall.(*LazyProc).Call(0x11460120, 0x115088e0, 0x3, 0x3, 0x0, 0x0, 0x201, 0x13)
C:/go/src/syscall/dll_windows.go:336 +0x89
github.com/gonutz/w32/v2.SetClassLongPtr(...)
D:/Projects/git/qxb_cus/pkg/mod/github.com/gonutz/w32/v2@v2.2.0/functions.go:790
github.com/gonutz/wui.(*Window).SetCursor(0x1144c2c0, 0x11412138)
C:/Projects/wui/window.go:520 +0x8c
main.main.func27(0x3da, 0x333)
C:/Projects/wui/cmd/designer/designer.go:1117 +0x543
github.com/gonutz/wui.(*Window).onMsg(0x1144c2c0, 0x5548e, 0x200, 0x0, 0x33303da, 0x14)
C:/Projects/wui/window.go:738 +0x1f0
syscall.Syscall(0x75d956c0, 0x1, 0x1150a1e0, 0x0, 0x0, 0x0, 0x0, 0x0)
C:/go/src/runtime/syscall_windows.go:188 +0xbb
syscall.(*Proc).Call(0x11405530, 0x1150886c, 0x1, 0x1, 0x4, 0xecf2a0, 0xf35001, 0x1150886c)
C:/go/src/syscall/dll_windows.go:180 +0x108
syscall.(*LazyProc).Call(0x1143bf80, 0x1150886c, 0x1, 0x1, 0x0, 0x1145b7d4, 0xf35070, 0x1013880)
C:/go/src/syscall/dll_windows.go:337 +0x54
github.com/gonutz/w32/v2.DispatchMessage(...)
D:/Projects/git/qxb_cus/pkg/mod/github.com/gonutz/w32/v2@v2.2.0/functions.go:676
github.com/gonutz/wui.(*Window).Show(0x1144c2c0, 0x0, 0x0)
C:/Projects/wui/window.go:959 +0x5c4
main.main()
C:/Projects/wui/cmd/designer/designer.go:1306 +0x454c

I found the problem, MSDN says:

Note To write code that is compatible with both 32-bit and 64-bit Windows, use SetClassLongPtr. When compiling for 32-bit Windows, SetClassLongPtr is defined as a call to the SetClassLong function

When I compile for 32 bit I get the same problem. I am on it.

Alright, this should be fixed in version 2.6.2. If you still encounter problems, re-open this issue or open another one. Thanks for your support! :-)