How can I tell if a "dll handle" is available?

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
arcticir
Posts: 578
Joined: 17 Nov 2013, 11:32

How can I tell if a "dll handle" is available?

15 Apr 2019, 09:19

This is an old problem that has existed for at least two years. I have feedback to you before.
I can't provide a test script because it has a low chance of appearing, but sometimes it happens frequently.
It always appears here:

Code: Select all

o.ahktextdll[code,,pi.name " & " pi.id]
I tried a lot of judgments, but it still didn't work:

Code: Select all

	o:=ahkdll()
	if isobject(o) and type(o.new)="DynaCall" and o.ready[]!=""
		if o.ahktextdll[code,,pi.name " & " pi.id]
			out:=pi.id
https://img01.sogoucdn.com/app/a/100520146/9B7B2E19F0B78A409A8E469B8EB653F6&oname=20190415220629.png
Image
HotKeyIt
Posts: 1876
Joined: 29 Sep 2013, 18:35
Contact:

Re: How can I tell if a "dll handle" is available?

15 Apr 2019, 14:55

Can you try putting this into a variable and also check the result of it when it fails: pi.name " & " pi.id
arcticir
Posts: 578
Joined: 17 Nov 2013, 11:32

Re: How can I tell if a "dll handle" is available?

16 Apr 2019, 02:01

HotKeyIt wrote:
15 Apr 2019, 14:55
Can you try putting this into a variable and also check the result of it when it fails: pi.name " & " pi.id
If it is wrong, it should be a regular error, not a "crash" error.
I will try.
arcticir
Posts: 578
Joined: 17 Nov 2013, 11:32

Re: How can I tell if a "dll handle" is available?

16 Apr 2019, 03:35

Invalid: :(

Code: Select all

Error: CONTINUABLE EXCEPTION_ACCESS_VIOLATION

Mouse and Keyboard hooks have been disabled.

  -  Press yes to exit thread and continue execution.
  -  Press no to continue thread (debug).
  -  Press cancel to exit application.

Exception was caused in thread id: 2620
Line: 429
Specifically: .new[code,,s]
LineFile: D:\float\Aurora\Lib\alga.ahk
arcticir
Posts: 578
Joined: 17 Nov 2013, 11:32

Re: How can I tell if a "dll handle" is available?

17 Apr 2019, 00:33

This is an example of a constant reboot. On my computer, within 10 seconds, it will go wrong.

https://drive.google.com/open?id=1hbfV6dhTwpxELgaVjwIkYnSalT_JM_R6
HotKeyIt
Posts: 1876
Joined: 29 Sep 2013, 18:35
Contact:

Re: How can I tell if a "dll handle" is available?

17 Apr 2019, 15:01

Can you try if it fails if you only redo the procedure including loading a new dll and threads without restarting, not sure how to debug restarting exe :(
If it fails too, please upload new example. Thank you ;)
arcticir
Posts: 578
Joined: 17 Nov 2013, 11:32

Re: How can I tell if a "dll handle" is available?

17 Apr 2019, 15:40

Sorry, this problem can only be reproduced with frequent restarts because the chances of reproduction are low.

Maybe you can try "debug" on the "restart" code:

Code: Select all

;test\script\test.ahk
run "debug.exe " A_AhkPath  ;run A_AhkPath
ProcessClose(ProcessExist())
=============
Found a new problem, it seems that only up to 59 DLL threads can now be loaded:

Code: Select all

dll:=fileread(a_ahkdir "\AutoHotkey.dll","raw")

loop 100
if !r:=MemoryLoadLibrary(&dll)
MsgBox a_index
HotKeyIt
Posts: 1876
Joined: 29 Sep 2013, 18:35
Contact:

Re: How can I tell if a "dll handle" is available?

17 Apr 2019, 17:24

Can't do it that way.
The 59 dlls problem does not exist for me, I can load 1000+ dlls
arcticir
Posts: 578
Joined: 17 Nov 2013, 11:32

Re: How can I tell if a "dll handle" is available?

17 Apr 2019, 18:29

I switched from Win32w_MT to Win32w. Strangely, the low random error disappeared.
The test script restarts the test for a long time and is still normal.
This is really strange.
HotKeyIt
Posts: 1876
Joined: 29 Sep 2013, 18:35
Contact:

Re: How can I tell if a "dll handle" is available?

18 Apr 2019, 15:18

MT is not multithreading compatible between exe and dll or dll and dll!!!
arcticir
Posts: 578
Joined: 17 Nov 2013, 11:32

Re: How can I tell if a "dll handle" is available?

19 Apr 2019, 13:20

Can you describe the "MT version" in detail?

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 10 guests