Using AutoHotkey.dll in vb.net
Started by
wickss
, Oct 13 2012 01:46 PM
15 replies to this topic
I am trying to use AutoHotkey.dll in VB.net. I have registered it with regsvr32. From the IDE I go to Project>Add Reference. It is not listed under the COM tab. When I browse to the dll and try to add it, I get the message, "A reference to 'X:\AutoHotkey.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."
Any ideas?
Any ideas?
#1
-
Posted 13 October 2012 - 01:46 PM
Does it work from AHK?
dll:=ComObjCreate("AutoHotkey.Script") dll.ahktextdll("MsgBox MsgBox from thread") MsgBox end
#2
-
Posted 13 October 2012 - 01:50 PM
Does it work from AHK?
dll:=ComObjCreate("AutoHotkey.Script") dll.ahktextdll("MsgBox MsgBox from thread") MsgBox end
Error on the first line. Call to a non-existent function.
#3
-
Posted 13 October 2012 - 02:05 PM
#4
-
Posted 13 October 2012 - 04:55 PM
Now it say "Invalid class string" in both AutoHokey_L and AutoHotkey_H.
#5
-
Posted 13 October 2012 - 06:28 PM
Are you on Win7?
#6
-
Posted 13 October 2012 - 09:23 PM
This is probably UAC, can you run as administrator or try using ComObjDll() in AutoHotkey_H.
lib:=DllCall("LoadLibrary","Str","AutoHotkey.dll","PTR") dll:=ComObjDll(lib,"{C00BCC8C-5A04-4392-870F-20AAE1B926B2}") ; AutoHotkey.dll v1.1 Default
#8
-
Posted 14 October 2012 - 09:37 AM
Running as administrator produces the same error. However the second bit of code runs uneventfully.
#9
-
Posted 14 October 2012 - 12:49 PM
So does the code run?
lib:=DllCall("LoadLibrary","Str","AutoHotkey.dll","PTR") dll:=ComObjDll(lib,"{C00BCC8C-5A04-4392-870F-20AAE1B926B2}") ; AutoHotkey.dll v1.1 Default dll.ahktextdll("MsgBox Thread") MsgBox End
#10
-
Posted 14 October 2012 - 01:01 PM
It ends prematurely without displaying the msgbox. It doesn't give me an error message.
#11
-
Posted 14 October 2012 - 02:22 PM
Can you check where it fails?
MsgBox % lib:=DllCall("LoadLibrary","Str","AutoHotkey.dll","PTR") MsgBox % IsObject(dll:=ComObjDll(lib,"{C00BCC8C-5A04-4392-870F-20AAE1B926B2}")) ; AutoHotkey.dll v1.1 Default MsgBox % dll.ahktextdll("MsgBox Thread") MsgBox End
#12
-
Posted 14 October 2012 - 05:31 PM
Which dll are you using and what is your system, 32 or 64-bit?
#14
-
Posted 14 October 2012 - 07:36 PM