| View previous topic :: View next topic |
| Author |
Message |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
Posted: Sat Aug 28, 2010 7:18 pm Post subject: |
|
|
This must be due to the latest changesAHK_L Changes History | Revision 54 wrote: | | Changed: */ at the beginning of a line is ignored if there was no /*. [Discussion] |
LoadFromText does not do that yet. | Code: | script := text := "text=`n(`ntext1 `n/* `nsome text `nin comments `ntags `n*/ `n`ntext2`n)`nMsgBox % text"
DllCall(A_AhkPath "\ahkExec","Str",script)
DllCall(A_AhkPath "\addScript","Str",script,"UInt",2) |
EDIT:
Try latest build, I changed: | Code: | if (in_comment_section)
{
if (!_tcsncmp(next_buf, _T("*/"), 2) && !in_continuation_section)
{
...
}
else if (in_comment_section)
continue;
} |
_________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun  |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Sun Aug 29, 2010 1:26 am Post subject: |
|
|
| Thanks. I've added a !in_continuation_section check to the if that encloses that section and removed the other (now redundant) check. Multi-line comments can't be used in continuation sections (and vice versa). |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
|
| Back to top |
|
 |
tdeus Guest
|
Posted: Tue Sep 28, 2010 9:41 am Post subject: |
|
|
I'm using HotKeyIt's release of the dll with Python. It's working fine otherwise, but the ControlFocus command doesn't seem to do anything.
Here's a very simple example. The following script opens an Open dialog in Notepad, and focuses the file type combo box.
| Code: | Run Notepad.exe
WinWait Untitled
Send ^o
WinWait Open
ControlFocus, ComboBox2, Open |
Here's the same thing with Python, but ControlFocus is not working, leaving the filename box focused.
| Code: | from ctypes import*
ahk = cdll.LoadLibrary("AutoHotkey.dll")
ahk.ahktextdll(c_char_p(""))
def execute(e):
ahk.ahkExec(c_char_p(e))
execute("Run, Notepad.exe")
execute("WinWait, Untitled")
execute("Send ^o")
execute("WinWait, Open")
execute("ControlFocus, ComboBox2, Open") |
Is there something wrong with my code or the ControlFocus command in the dll somehow faulty? |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
Posted: Wed Oct 13, 2010 6:17 am Post subject: |
|
|
| AutoHotkey_L61H26 wrote: | - Build in COM Interface (AutoHotkey.dll only)
- - All methods are called same as exported function and have same parameters. E.g. ahkdll, ahktextdll, ahkExec, ahkReady.... |
To use COM Interface, AutoHotkey.dll needs to be registered.
| Code: | Run regsvr32.exe x:\AutoHotkey.dll ;register
Run regsvr32.exe /u x:\AutoHotkey.dll ;unregister when not required anymore |
Virtual Basic example.
| Code: | Sub atest()
Dim ahk As Object
Set ahk = CreateObject("AutoHotkey.Script")
ahk.ahktextdll ("MsgBox Hello World!" & Chr(13) & "ExitApp")
End Sub |
Ahk example | Code: | Run regsvr32.exe /s x:\AutoHotkey.dll ;register Dll
Sleep, 2000 ;give it some time to process registration
ahk:=ComObjCreate("AutoHotkey.Script")
ahk.ahktextdll("MsgBox Hello World!`nExitApp")
While ahk.ahkReady()
Sleep, 100
Run regsvr32.exe /s /u x:\AutoHotkey.dll ;unregister Dll |
EDIT:
Small bugfix with hotkeys.
EDIT:
Merged latest AHK_L fixes.
Source updated _________________ AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun  |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Wed Oct 13, 2010 7:31 pm Post subject: |
|
|
| HotKeyIt wrote: | | AutoHotkey_L61H26 wrote: | | - Build in COM Interface (AutoHotkey.dll only) |
|
I'm impressed
This should make using the DLL easier for users who struggle with DllCall(). Plus, the simplicity of embedding AHK in another language is amazing! _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 4653 Location: AHK Forum
|
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Thu Oct 14, 2010 2:26 am Post subject: |
|
|
It might be worth mentioning that you can check if an ActiveX control (DLL) is registered by simple checking for the ProgID in the Registry: | Code: | RegRead, D, HKCR, AutoHotkey.Script
if Errorlevel ; or If D =
MsgBox, DLL Not Registered
else
MsgBox, DLL is Registered |
One down side to the COM interface is it seems like you'd only be able to use 1 additional thread, since you can only register the ActiveX control once. Here's an example of multithreading (assuming the DLL/ActiveX Control is already registered): | Code: | code =
(
#NoTrayIcon
MsgBox, Message from COM/DLL
)
ahk := ComObjCreate("AutoHotkey.Script")
ahk.AHKtextDll(code)
MsgBox, Message from Script |
Also, here's another quick example with JScript: | Code: | code = "#NoTrayIcon\n"
+ "MsgBox Message from AHK"
ahk = new ActiveXObject("AutoHotkey.Script")
ahk.AHKtextDll(code)
while (ahk.ahkReady())
continue |
_________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Last edited by jethrow on Thu Oct 14, 2010 3:02 am; edited 1 time in total |
|
| Back to top |
|
 |
guest3456 Guest
|
Posted: Thu Oct 14, 2010 2:52 am Post subject: |
|
|
| are there any code examples of using this for multithreading from an AHK script? |
|
| Back to top |
|
 |
hoppfrosch
Joined: 25 Jan 2006 Posts: 190 Location: Froschtümpel
|
Posted: Thu Oct 14, 2010 6:18 am Post subject: |
|
|
| HotKeyIt wrote: |
To use COM Interface, AutoHotkey.dll needs to be registered.
| Code: | Run regsvr32.exe x:\AutoHotkey.dll ;register
Run regsvr32.exe /u x:\AutoHotkey.dll ;unregister when not required anymore |
|
Registering Autohotkey.dll does not work on my Win7 x64 System:
| regsvr32.exe wrote: |
Module X:\AutoHotKey.dll was loaded, but DllRegisterServer-Entrypoint was not found. Please make sure, that X:\AutoHotKey.dll is a valid .DLL or .OCX file and repeat the action.
|
(freely translated from german). For sure I used the correct path (not X:\AutoHotKey.dll as given in example)
Any hints on this?
BTW: What is needed for running AutoHotKey.dll? Is AutoHotKey_N.exe needed or is it sufficient to copy AutoHotKey.dll? Within the first topic of this thread it might be helpful to explain a bit more detailed , what prerequisites are needed for using AutoHotKey.dll ... You also mention AutoHotKey_H there - what's this variant needed for? What's the main difference to AutoHotKey_N or AutoHotKey_L?
For sure one can get this information out of the thread (or from AutoHotKey.dll-Homepage), but
- this thread is quite lengthy - and it's difficult for a newbie to extract the desired information
- this thread is historically grown and reflects the changes on AutoHotKey.dll-family. It's difficult to see, which properties/behaviour are currently valid for AutoHotKey.dll.
I don't expect detailled answers on this - just take it as encouragement to make your first topic of this thread more friendly for new users to gain easier entry to the world of AutoHotKey.dll ... |
|
| Back to top |
|
 |
hoppfrosch
Joined: 25 Jan 2006 Posts: 190 Location: Froschtümpel
|
Posted: Thu Oct 14, 2010 6:28 am Post subject: |
|
|
| hoppfrosch wrote: |
Registering Autohotkey.dll does not work on my Win7 x64 System:
| regsvr32.exe wrote: |
Module X:\AutoHotKey.dll was loaded, but DllRegisterServer-Entrypoint was not found. Please make sure, that X:\AutoHotKey.dll is a valid .DLL or .OCX file and repeat the action.
|
(freely translated from german). For sure I used the correct path (not X:\AutoHotKey.dll as given in example)
Any hints on this?
|
Wrong alert on this - this happens when downloading the DLL as standalone-DLL linked from the first topic of this thread as " AutoHotkey.dll_N".
Using the AutoHotKey.dll from Binary-Package by HotkeyIt from AutoHotKey.dll-Homepage everything works ...
(One more hint to overthink the structure/contents of the first topic of this thread ...) |
|
| Back to top |
|
 |
|