AHKHID icon indicating copy to clipboard operation
AHKHID copied to clipboard

Error: Call to nonexistent function.

Open Bluscream opened this issue 9 years ago • 4 comments

When i execute example_1.ahk i always just get

---------------------------
example_1.ahk
---------------------------
Error:  Call to nonexistent function.

Specifically: AHKHID_UseConstants()

	Line#
	020: Gui,Add,ListView,x16 y40 w440 h150 vlvwKeyb gLV_Event AltSubmit,Name|Type|SubType|Keyboard Mode|Number of Function Keys|Number of Indicators|Number of Keys Total
	021: Gui,Tab,2
	022: Gui,Add,ListView,x16 y40 w440 h150 vlvwMouse gLV_Event AltSubmit,Name|Mouse ID|Number of Buttons|Sample Rate
	023: if bVista  
	024: LV_InsertCol(5, "", "Has Horizontal Wheel")  
	025: Gui,Tab,3
	026: Gui,Add,ListView,x16 y40 w440 h150 vlvwOther gLV_Event,Name|Vendor ID|Product ID|Version Number|Usage Page|Usage
--->	029: AHKHID_UseConstants()  
	032: iCount := AHKHID_GetDevCount()
	035: Loop,%iCount%
	035: {
	037: HID0 += 1
	040: HID%HID0%_Handle := AHKHID_GetDevHandle(HID0)
	041: HID%HID0%_Type := AHKHID_GetDevType(HID0)
	042: HID%HID0%_Name := AHKHID_GetDevName(HID0)

The program will exit.
---------------------------
OK   
---------------------------

Bluscream avatar Apr 10 '17 20:04 Bluscream

You need to include the library in your code.

Download AHKHID.ahk to the same directory as example_1.ahk: https://github.com/jleb/AHKHID/raw/master/AHKHID.ahk Add `#include AHKHID.ahk' to the top of the example.

MacroMan avatar Apr 25 '17 13:04 MacroMan

This begs the question "Why don`t the examples already contain this line in them?" You never want examples to require setup.

rjb25 avatar Dec 19 '17 03:12 rjb25

Ran into same problem, suggested fix worked.

xaviershay avatar Mar 17 '18 19:03 xaviershay

This is really dumb :)

timdonovanuk avatar Aug 29 '20 23:08 timdonovanuk