An object

Ask for help, how to use AHK_H, etc.
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

An object

29 Aug 2018, 12:51

I have encountered this error many times, but I still can't understand the cause of the error. What does it mean?
Error in #include file "alga.ahk":
Invalid value.

Specifically: An object.

Line#

065: Return
068: Gosub "head"
069: if A_self.module
070: {
---> 071: o := ahkdll()
072: }
072: Else
073: {
074: r := A_Event.ahkdll
075: o := r.call()
076: }


The current thread will exit.

Code: Select all

ahkdll(){
	return CriticalObject({"":r:=MemoryLoadLibrary(A_DllAddress)
	,"func":DynaCall(MemoryGetProcAddress(r,"ahkFunction"),"s==sssssssssss")
	,"post":DynaCall(MemoryGetProcAddress(r,"ahkPostFunction"),"i==sssssssssss")
	,"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")
	,"ready":DynaCall(MemoryGetProcAddress(r,"ahkReady"),"")
	,"reload":DynaCall(MemoryGetProcAddress(r,"ahkReload"),"i==i")})
}
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: An object

29 Aug 2018, 14:57

It must be comming from here: https://github.com/HotKeyIt/ahkdll/blob ... r.cpp#L596
I would need an example to check why this happens, this works fine for me:

Code: Select all

ahkdll:=ahkdll()
MsgBox ahkdll.new("MsgBox 'dll'")
ahkdll(){
	static hRes,ahkdll, init:=UnZipRawMemory(LockResource(LoadResource(0,hRes:=FindResource(0,"F903E44B8A904483A1732BA84EA6191F",10))),SizeofResource(0,hRes),ahkdll),A_DllAddress:=&ahkdll
	return CriticalObject({"":r:=MemoryLoadLibrary(A_DllAddress)
	,"func":DynaCall(MemoryGetProcAddress(r,"ahkFunction"),"s==sssssssssss")
	,"post":DynaCall(MemoryGetProcAddress(r,"ahkPostFunction"),"i==sssssssssss")
	,"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")
	,"ready":DynaCall(MemoryGetProcAddress(r,"ahkReady"),"")
	,"reload":DynaCall(MemoryGetProcAddress(r,"ahkReload"),"i==i")})
}
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: An object

29 Aug 2018, 15:21

Sorry, because it appears random, it appears in a few days (when WIN starts), I can't actively reproduce it.
Can "error tips" provide more reasons?

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 23 guests