sxzxs / cherry-snippet-v2

Snippet management tools, if ahk python bat ...code, can be executed directly
44 stars 6 forks source link

无法正常运行:Error: Call to nonexistent function #2

Closed luboq closed 1 year ago

luboq commented 1 year ago

全新安装,尝试运行cherry-snippet.ah2时,无法正常运行,报错如下图

Error: Call to nonexistent function.

    ---- D:\Dropbox\Technical_Backup\warehouse\cherry-snippet-v2\Lib\TextRender.ahk
    033: this.style1 := ""
    034: this.style2 := ""
▶   037: dpi := DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
    038: If !(this.hwnd := this.CreateWindow(title, style, styleEx, parent))
    039: Throw Error("Max threads reached. Set #MaxThreads to a higher limit.")

The current thread will exit.

Call stack:
D:\Dropbox\Technical_Backup\warehouse\cherry-snippet-v2\Lib\TextRender.ahk (37) : [DllCall] dpi := DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
D:\Dropbox\Technical_Backup\warehouse\cherry-snippet-v2\Lib\TextRender.ahk (37) : [TextRender.Prototype.__New] dpi := DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
D:\Dropbox\Technical_Backup\warehouse\cherry-snippet-v2\Lib\TextRender.ahk (16) : [Object.Call] Return super()
D:\Dropbox\Technical_Backup\warehouse\cherry-snippet-v2\Lib\TextRender.ahk (16) : [TextRender.call] Return super()
D:\Dropbox\Technical_Backup\warehouse\cherry-snippet-v2\cherry-snippet.ah2 (77) : [main] g_tr := TextRender()
D:\Dropbox\Technical_Backup\warehouse\cherry-snippet-v2\cherry-snippet.ah2 (61) : [] main()
> Auto-execute

环境:Win7 x64,AutoHotkey v2.0.2

我不知道是否与这个有关,使用DirectX Repair检测C++组件时,如下图,2005 2008 2010都检测失败,且用 DirectX Repair 无法修复成功,原因未知: image

有什么解决办法吗?

sxzxs commented 1 year ago

SetThreadDpiAwarenessContext这个函数是win10的 37行和40行注释掉就行

sxzxs commented 1 year ago

720101589 qq交流群