Code: Select all
NewThread("Msgbox `% variable:=`"Thread`"")
The following code from the documentation does not show a message in the Message box. I just want to get a general idea of how multithreading works. I just switched to AHK_H a few days ago, simply for its multithreading. But there are errors left and right, when I copy/paste examples from the documentation.
Code: Select all
Command Example: NewThread "MsgBox Message from thread."
Function Example: ThreadID := NewThread("MsgBox Message from thread.")
The message boxes are emtpy. No text
Code: Select all
ahkdll:=AhkThread("Msgbox `% variable:=`"Thread`"") ; Loads the AutoHotkey module and starts the script.
While !ahkdll.ahkgetvar.variable
Sleep 50 ; wait until variable has been set.
MsgBox % ahkdll.ahkgetvar.variable ; Display content of variable in thread
ahkthread_free(ahkdll),ahkdll:="" ; Stop execution in thread and free resources.
Any advice would be appreciated. Thanks!