Error box visibility in virtual environment

delphi package - automated exception handling
Post Reply
anders_g
Posts: 3
Joined: Wed Dec 27, 2017 7:56 am

Error box visibility in virtual environment

Post by anders_g »

We use MadExcept to handle exceptions, and now we are trying to integrate our app in Thinfinity VirtualUI from Cybelesoft (cybelesoft.com). It seems the way the error boxes are constructed without VCL doesn't work well together with Thinfinity. Only a empty blue box is diplayed - see enclosed picture.

Does anyone have experience of handling this?
/Anders
Attachments
Empty error box
Empty error box
2019-02-26 17-51-21.png (8.28 KiB) Viewed 4238 times
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Error box visibility in virtual environment

Post by madshi »

I've never seen this before. Not sure what Thinfinity VirtualUI does exactly. Have you tried contacting their support?
anders_g
Posts: 3
Joined: Wed Dec 27, 2017 7:56 am

Re: Error box visibility in virtual environment

Post by anders_g »

I am not quite clear on the function of Thinfinity either, but I guess they are transforming VCL drawing to HTML5 in som electronic way, and as MadExcept doesn't use VCL, they are probably missing it.
A simple solution to this would be to catch the errors and construct my own error boxes - with VCL. I understand this is no good, but how bad is it?
/Anders
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Error box visibility in virtual environment

Post by madshi »

The key problem with VCL is that it's not thread safe. So you can't show VCL forms in the context of secondary threads. However, madExcept does most of its work in secondary threads to make sure that a crashed main thread doesn't stop madExcept from working correctly.

You can tell madExcept.RegisterExceptionHandler() to call your handler in the context of the main thread. If you do that, you can show your own VCL form in there and then set "handled := true" to tell madExcept that you don't want madExcept's own exception box to be shown. Of course this will only work if the main thread is still alive and kicking, otherwise madExcept won't be able to call your handler in the context of the main thread.
Post Reply