crzftx Posted January 7, 2010 Share Posted January 7, 2010 (edited) deleted Edited August 9, 2017 by crzftx Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 7, 2010 Share Posted January 7, 2010 That would require a callback. Look into DllCallbackRegister. Link to comment Share on other sites More sharing options...
crzftx Posted January 7, 2010 Author Share Posted January 7, 2010 (edited) deleted Edited August 9, 2017 by crzftx Link to comment Share on other sites More sharing options...
martin Posted January 7, 2010 Share Posted January 7, 2010 I've recently written some AI for a game written in AutoIt. For speed purposes, the AI is written in C++. One method to communicate with the C++ was to FileWrite(), wait for the contents to change, and then FileRead(). This works well, since while AutoIt is sleeping (waiting for the file contents to change), the GUI still functions (it's OnEvent).Today, I decided to write the AI into a DLL (I feel it's much more elegant). However, I now run into the problem that AutoIt completely stops while waiting for the DLLCall to return. The GUI is completely functionless during this period: input boxes do not accept input, the window cannot be moved or resized, buttons do not glow on hover, etc.My question is: is there any way to wait for the DLLCall to return in the background?I think a callback approach would not be so helpfull, and anyway not needed. Your original approach worked so I think you should simply reproduce the approach with messages. Before you waited for a file to be created so you could send a message from the AutoIt Script (A) to the C++ program © to say "Info X wanted", C replies with "OK will do" straight away so that A is idle again, then when the info is ready C sends A a message saying "here is the info". Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now