[BUG] dllcall err

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

[BUG] dllcall err

26 Sep 2018, 08:03

Error in #include file "McodeH.ahk":
Call to nonexistent function.

Line#
143: }
001: {
003: if !f
004: f:={},DynaCalls:={}
005: if DynaCalls.HasKey(h)
006: Return DynaCalls[h]
007: f.Push(h),f.SetCapacity(f.Length(),len:=StrLen(h)//2)
---> 008: DllCall("VirtualProtect","PTR",addr:=f.GetAddress(f.Length()),"Uint",len,"UInt",64,"Uint*",0)
009: Loop len
010: NumPut("0x" SubStr(h,2*A_Index-1,2),addr,A_Index-1,"Char")
011: if p.Length()
012: Return DynaCalls[h]:=DynaCall(addr,def,p*)
013: Else
013: Return DynaCalls[h]:=DynaCall(addr,def)
014: }

The current thread will exit.
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: [BUG] dllcall err

26 Sep 2018, 08:39

No problems here, can you show your code?
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: [BUG] dllcall err

26 Sep 2018, 09:34

in dll ;)
f:=AhkThread("DllCall(`"QueryPerformanceCounter`",`"Int64P`",n)")
MsgBox
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: [BUG] dllcall err

29 Sep 2018, 08:59

Thanks.

This update has brought some problems, but I am not sure how it came about.
It only appears randomly at startup.
ahktextdll[code,,pi.name " " pi.id]
Image
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: [BUG] dllcall err

29 Sep 2018, 09:04

That is odd, is it always the same line causing that error?
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: [BUG] dllcall err

29 Sep 2018, 10:47

Yes, the problem is always in this line.



Another problem.
I am deleting nested functions.
In multithreading environments, they are very unstable and have strange problems.
When I modified them into ordinary functions, everything became normal. ;)
---------------------------
search_zhihu .18
---------------------------
Error in #include file "D:\float\Aurora\Lib\op.ahk":
Func out of scope.

Specifically: _port

Line#
051: For c,z in {"\b":Chr(08),"\\":"\","\t":" ","\n":"
","\f":Chr(12),"\r":"
"}
052: if InStr(s,c)
053: s := StrReplace(s,c,z)
054: Return StrReplace(s,"\/","/")
055: }
001: {
024: _first(url)
---> 028: _port()
030: _load()
031: _opt()
032: _send()
034: if !this.__head
035: _headers()
037: _receive()
039: _tail()

The current thread will exit.
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

[BUG] MaxThreadsBuffer invalid

01 Oct 2018, 07:32

don't know why the forum can't publish new posts, so Release are here. :(

----------------------

In the following example, every time you press "RALT", no matter how much time it takes, "ID" will only +1.
However, if the "Critical" command is used, the hotkey of the period will change from "ignore" to "cache".

Code: Select all

#MaxThreadsPerHotkey 1
#MaxThreadsBuffer off
#Persistent
id:=0
CreateClass("tt")
CreateWindowEx(0,"tt",,0,0,0,0,0,0,0,0,0)
RAlt::
ToolTip ++id
KeyWait "ralt"
return


CreateClass(name,func:="CreateClass_proc",back:=16,hIcon:=0){
	UnregisterClass(&name,A_ModuleHandle)
	c:=struct(r:="UINT cbSize;UINT style;LPDWORD lpfnWndProc;int cbClsExtra;int cbWndExtra;HINSTANCE hInstance;HICON hIcon;HCURSOR hCursor;HBRUSH hbrBackground;LPCSTR lpszMenuName;UINT lpszClassName;HICON hIconSm;"
		,{cbSize:sizeof(r),style:3,lpfnWndProc:func is "integer" ?func:CallbackCreate(func,"f",4),cbClsExtra:0,cbWndExtra:0
			,hInstance:A_ModuleHandle,hIcon:hIcon,hCursor:LoadCursor(0,32512),hbrBackground:back
			,lpszMenuName:0,lpszClassName:&name,hIconSm:hIconSm=""?hIcon:hIconSm})
	return  RegisterClassEx(c[""])
}

CreateClass_proc(h,m,w,l){
    Critical		;<<<<Murderers
	return DefWindowProc(h,m,w,l)
}
I only tested the DLL thread.
In my script, even if I deleted the "Critical" command, I still couldn't ignore the hotkey, and I couldn't figure out why.
Last edited by arcticir on 01 Oct 2018, 07:38, edited 2 times in total.

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 15 guests