Jump to content

COM functions blocking AutoIt message queue


Bowmore
 Share

Recommended Posts

Could anyone suggest a possible work around for a problem I have

I'm using AutoIt to generate and submit queries to a very large Oracle database using Oracles 'OO4O' COM objects (similar to ADOB).

The SQL queries can take several hours or even days to run in some cases. The issues I have is that while the query is being processed the AutoIt message queue is blocked this results in the GUI not being painted when required. This can lead to the user assuming that the process has crashed or locked and then using task manager to stop it prematurely. It is also not possible to give the user any feedback that the process is still running by using a $PBS_MARQUEE style progress bar or by updating a timer using AdlibEnable().

Any ideas on how I can keep the user informed that the application is still running normally?

Sorry I haven't been able to come up with a simple demo that will demonstrate this issue, I'm still looking for a common COM function that can take a while to return so I can build a demo script for you.

Thanks

Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

AutoIt is not multi-threaded. You need to kick that query as a separate process. The script could, for example, launch a second instance of itself with command line parameters for the query, that will pass any results back to the parent instance's GUI.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

AutoIt is not multi-threaded. You need to kick that query as a separate process. The script could, for example, launch a second instance of itself with command line parameters for the query, that will pass any results back to the parent instance's GUI.

:P

Thanks PsaltyDS

That sounds like a fairly straightforward way to achieve the desired result. I should have thought of that myself as I have used the two applications working together approach in the past. The application already outputs the results to text files and updates a log file with the start and end times for each query plus any errors. So all I need to do is move the COM bits into a seperate non gui application using passing the parameters as command line arguments as you suggest and moniter the log file from the GUI app.

Nice one thanks

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...