Page 1 of 1

Error box visibility in virtual environment

Posted: Wed Feb 27, 2019 7:43 am
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

Re: Error box visibility in virtual environment

Posted: Thu Feb 28, 2019 9:32 am
by madshi
I've never seen this before. Not sure what Thinfinity VirtualUI does exactly. Have you tried contacting their support?

Re: Error box visibility in virtual environment

Posted: Wed Mar 27, 2019 8:01 am
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

Re: Error box visibility in virtual environment

Posted: Wed Mar 27, 2019 9:30 am
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.