In the examples functions like Alias() and CritialObject() work fine when using a thread created within the main script
Code: Select all
project1:={Key:"this is a test"}
cObj := CriticalObject(project1)
threadD := AhkThread("
(
project1 := CriticalObject(" (&cObj) ")
MsgBox `% project1.Key
)")
While threadD.ahkReady()
Sleep 200
Main file:
Code: Select all
project1:={Key:"this is a test"}
cObj := CriticalObject(project1)
threadD := AhkThread("threadfile.ahk",,1)
While threadD.ahkReady()
Sleep 200
Code: Select all
project1 := CriticalObject(" (&cObj) ")
MsgBox % project1.Key
https://hotkeyit.github.io/v2/docs/commands/AhkThread.htm
It shows the syntax to be:
OutputVar := AhkThread(ScriptOrFile, Parameters, Title, ScriptIsFile, DllToUse)
where 'ScriptIsFile' is the 4th Parameter but will only work if it is used as the 3rd parameter.