Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to set SEM_FAILCRITICALERRORS on startup with VCL?

I've found that it is recommended to call the SetErrorMode(SEM_FAILCRITICALERRORS) on application startup:
https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode

I know that VCL code sets this mode temporarily in some functions. But it does not do this globally on application startup.

As I do not see any advantage of the default behavior, I'm considering setting it explicitly from my code. I just wonder, if VCL is designed to run in this mode. Is anyone aware of any potential problem? Any reason, why VCL does not set this mode itself?

like image 308
Martin Prikryl Avatar asked Jan 23 '26 06:01

Martin Prikryl


1 Answers

It's perfectly fine in a VCL application to follow the MSDN advice and set SEM_ FAILCRITICALERRORS at startup.

like image 54
David Heffernan Avatar answered Jan 25 '26 17:01

David Heffernan