Catching runtime errors or closing them via a shell

Hi team
I have a large complex app that requires a number of plugins and connects to specialized hardware making it a nightmare to get help with my code.

I’m seeing a runtime error that creates one or sometimes many modal dialogs complaining about objects.cpp
My question is, while I get these errors, my app works ok if I close them. Is there a way to programmatically check for the open window and close it in the background. I know this is a work around and I would love to know why they happen but debugging is proving fruitless.

The issue with trying to do the above is that none of the standard windows command line tools show the modal window other than a program from nirsoft called Winlister that allows me to see the window and also kill it.

Anyone know the api they might be using to see this?
Running windows 10 and 2023R4 as a desktop app.

Just yesterday I rediscovered an open source language called AutoIt. You can have it look for a window with the title of “Runtime Error” and then have it attempt to read the content of the label in the dialog to send information back to your app.

If you write an AutoIt script that does this, you can compile it to an exe and run it as a helper app, or it also ships with a DLL that you can write declares for and integrate it into Xojo directly, this way you can have a timer check for the “Runtime Error” window periodically during times when you’re running a program that might crash, then retrieve the data from the window, send an automated click to the OK button, and proceed with your program flow.

There’s a bit of a learning curve but I was writing working Xojo code utilizing it in about an hour.

Thanks Christian

I’ll check it out and report back.

The best would be to reproduce it for Xojo and have them fix the assertion.

Hey Greg.

Trust me I’d love to. I just can’t figure out why it’s happening and it’s not repeatable. Sometimes it happens within minutes. Other times it’s after hours. Not on some computers etc. if there was a way to get closer to the reaso. I’d love to hear from someone.