What is _USRDLL and why autohotkey.dll v2 (alpha) doesn't call UnregisterClass when it's defined?

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
salowabicz
Posts: 2
Joined: 24 Nov 2017, 13:45

What is _USRDLL and why autohotkey.dll v2 (alpha) doesn't call UnregisterClass when it's defined?

24 Nov 2017, 13:53

Asking this because I'm using the advertised "multi-threading by loading a dll multiple times and using its exported functions" approach to execute multiple scripts on the fly. However, there are some legacy scripts which autohotkey.dll v2 (alpha) refuses to run. So, I'm trying to execute them using the autohotkey.dll v1.1, but all I get is the mysterious "RegClass" message. I found out that this happens because the previously loaded autohotkey.dll v2 (alpha) did not call UnregisterClass to unregister "AutoHotkey" window class.

Both dlls I use are lastest compiled releases (Win32w).
HotKeyIt
Posts: 1713
Joined: 29 Sep 2013, 18:35
Contact:

Re: What is _USRDLL and why autohotkey.dll v2 (alpha) doesn't call UnregisterClass when it's defined?

24 Nov 2017, 17:10

Which version are you using and how do you create additional threads?

_USRDLL is a directive for code that exists only for AutoHotkey.dll and not AutoHotkey.exe.
I have added UnregisterClass for AutoHotkey.dll.
salowabicz
Posts: 2
Joined: 24 Nov 2017, 13:45

Re: What is _USRDLL and why autohotkey.dll v2 (alpha) doesn't call UnregisterClass when it's defined?

25 Nov 2017, 07:59

Thanks for quick reaction. As I said, I was using latest compiled binaries (Win32W) from http://hotkeyit.github.io/v2/. As for threading, I'm loading the dll from memory for each thread. The problem occured if autohotkey.dll v2 was unloaded, and autohotkey.dll v1.1 was loaded into the same address space afterwards. In this case both dlls were using the same hInstance, but autohotkey.dll v2 forgot to call UnregisterClass before unloading. This resulted in failure of autohotkey.dll v1.1 registering the class. Normally, this error would occur with autohotkey.dll v2 alone, unless its "RegClass" check was stripped out. Anyways, thanks for fixing the issue.
Last edited by salowabicz on 25 Nov 2017, 12:18, edited 1 time in total.

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 2 guests