Sign in to follow this  
Followers 0
crzftx

Background DLLCall

4 posts in this topic

#1 ·  Posted (edited)

deleted

Edited by crzftx

Share this post


Link to post
Share on other sites



That would require a callback. Look into DllCallbackRegister.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

deleted

Edited by crzftx

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0