Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Virtual Desktop: A_LastError: 14007 #72

Open
koppor opened this issue Sep 2, 2023 · 1 comment
Open

Create Virtual Desktop: A_LastError: 14007 #72

koppor opened this issue Sep 2, 2023 · 1 comment

Comments

@koppor
Copy link

koppor commented Sep 2, 2023

Disclaimer: It could be that my Windows is broken - see https://aka.ms/AAmdzjq

I try to create a virtual desktop using a short AHK script:

VDA_PATH := A_ScriptDir . "\VirtualDesktopAccessor.dll"
hVirtualDesktopAccessor := DllCall("LoadLibrary", "Str", VDA_PATH, "Ptr")
CreateDesktopProc := DllCall("GetProcAddress", "Ptr", hVirtualDesktopAccessor, "AStr", "CreateDesktop", "Ptr")

CreateDesktop() {
    global CreateDesktopProc
    try {
        ran := DllCall(CreateDesktopProc)
        if (ErrorLevel = "FAIL") {
            MsgBox % "DllCall failed with ErrorLevel: " ErrorLevel
            return
        }
        if (A_LastError != 0) {
            MsgBox % "A_LastError: " A_LastError
            return
        }
        MsgBox % "Return value: " ran
    } catch e {
        MsgBox % "Exception: " e.Message
    }
    return ran
}

CreateDesktop()

I get A_LastError: 14007 when executing.

Does this happen for everyone - or just for me?

@Ciantic
Copy link
Owner

Ciantic commented Sep 2, 2023

Did you try with the latest Windows 11 binary? To me whole DLL stopped functioning on 31st of August, and I released a new binary 2 days ago.

Latest binary works only with at least 22621.2215, start winver.exe, and see what your version is.

image

My unit/integration test shows that create desktop should function:

running 1 test
Retry the function after ComNotInitialized
test tests::test_create_desktop ... ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants