HotKeyIt / ahkdll-v2-release

AutoHotkey_H v2 release

Home Page:http://hotkeyit.github.io/v2/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CriticalObject and ahkPostFunction err

chaoxi24 opened this issue · comments

This example has multiple errors.

pin:=CriticalObject()

pin.test:=ahkload()

pin.test.new["#NoTrayIcon`n#Persistent"]

While !pin.test.is[]
	sleep 15

for i,n in pin.test.OwnProps()
s.=i "`n"
MsgBox s

t:=pin.test.post
t["MsgBox","ttt"]
MsgBox "It should be displayed immediately"
t:=pin.test.post
t["MsgBox","ttt"]
MsgBox "It should be displayed immediately"

ahkload(){
	static a_dllRes:=(UnZipRawMemory(LockResource(hr:=LoadResource(0,s:=FindResource(0,"F903E44B8A904483A1732BA84EA6191F",10))),SizeofResource(0,s),a_dllRes),FreeResource(hr),a_dllRes)
	return CriticalObject({_:r:=MemoryLoadLibrary(&a_dllRes),
		func:DynaCall(t:=MemoryGetProcAddress(r,"ahkFunction"),"s==sssssssssss"),__func:t,
		post:DynaCall(t:=MemoryGetProcAddress(r,"ahkPostFunction"),"i==sssssssssss"),__post:t,
		new:DynaCall(MemoryGetProcAddress(r,"ahkTextDll"),"ut==sss"),
		add:DynaCall(MemoryGetProcAddress(r,"addScript"),"ut==si"),
		exec:DynaCall(MemoryGetProcAddress(r,"ahkExec"),"ut==sui"),
		get:DynaCall(MemoryGetProcAddress(r,"ahkGetVar"),"s==sui"),
		set:DynaCall(MemoryGetProcAddress(r,"ahkAssign"),"ui==ss"),
		sub:DynaCall(MemoryGetProcAddress(r,"ahkLabel"),"ui==sui"),
		pause:DynaCall(MemoryGetProcAddress(r,"ahkPause"),"i==s"),
		exit:DynaCall(MemoryGetProcAddress(r,"ahkTerminate"),"i==i"),
		is:DynaCall(MemoryGetProcAddress(r,"ahkReady"),""),
		reload:DynaCall(MemoryGetProcAddress(r,"ahkReload"),"i==i")})
}

This has been fixed, thanks for example.