Error: Call to nonexistent function.
WiliTest opened this issue · comments
When I run the COM.ahk I get this error:
---------------------------
COM.ahk
---------------------------
Error: Call to nonexistent function.
Specifically: errord("silent", "COM Error Notification", "Function Name: """ . name . """
ERROR: " . sError . " ("...
Line#
226: bDebug := hr
228: Return,COM_HR&&COM_LR ? COM_LR<<32|COM_HR:COM_HR
229: }
230: Else
230: if !bDebug
231: Return
232: hr ? (VarSetCapacity(sError,1023),VarSetCapacity(nError,10),DllCall("kernel32\FormatMessageA","Uint",0x1000,"Uint",0,"Uint",hr<>0x80020009 ? hr : (bExcep:=1)*(hr:=NumGet(pei+28)) ? hr : hr:=NumGet(pei+0,0,"Ushort")+0x80040200,"Uint",0,"str",sError,"Uint",1024,"Uint",0),DllCall("user32\wsprintfA","str",nError,"str","0x%08X","Uint",hr,"Cdecl")) : sError:="The COM Object may not be a valid Dispatch Object!
First ensure that COM Library has been initialized through COM_Init().
", lr ? (VarSe
---> 233: errord("silent", "COM Error Notification", "Function Name: """ . name . """
ERROR: " . sError . " (" . nError . ")" . (bExcep ? SubStr(NumGet(pei+24) ? DllCall(NumGet(pei+24),"Uint",pei) : "",1,0) . "
PROG: " . COM_Ansi4Unicode(NumGet(pei+4)) . COM_SysFreeString(NumGet(pei+4)) . "
DESC: " . COM_Ansi4Unicode(NumGet(pei+8)) . COM_SysFreeString(NumGet(pei+8)) . "
HELP: " . COM_Ansi4Unicode(NumGet(pei+12)) . COM_SysFreeString(NumGet(pei+12)) . "," . NumGet(pei+16) : "") . (lr ? "
ERROR2: " .
235: Exit
236: }
239: {
241: if Not VarSetCapacity(IDispatch)
242: {
243: VarSetCapacity(IDispatch,28,0), nParams=3112469
244: Loop,Parse,nParams
The program will exit.
---------------------------
OK
---------------------------
It appears that you attempted to run COM.ahk by double-clicking on it. Note that COM.ahk is a library of functions, so you would use it by including COM.ahk in another script file, then calling one of those functions from that script.
Also, note that COM.ahk was created by Sean, and this file that you have downloaded is my copy of COM.ahk, with some slight modifications to the error handling. I would recommend visiting Sean's page for instructions on his library.
https://autohotkey.com/board/topic/21142-com-standard-library/
Thank you very much for your reply and the link Camerb! (The one from Sean seems to work in my case)