I need to catch an integer to zero and gain access to read or write protected memory and display my own dialog and do something suitable. This exception cannot be caught by the try {} catch {} method, because the hardware throws these exceptions. How can I catch exceptions there? Any suggestions or links to related articles are evaluated by mr.abzadeh
It is strange that it is not possible to catch these exceptions. but if so, then I think you can put your own checks and throw your own exceptions. But again, you can miss something ...
See the documentation for the __try / __except mechanism. This is used on Windows to detect hardware exceptions.
__try
__except
There is a very simple way to catch any exception (division by zero, violation of access rights, etc.) in Visual Studio using try -> catch (...) block :)
A small project setup is enough. Just enable / EHa in the project settings. See Project Properties -> C / C ++ -> Code Generation -> Change C ++ Exception Exceptions to "Yes with SEH Exceptions" . What is it!
See here for more details: http://msdn.microsoft.com/en-us/library/1deeycx5 (v = vs .80) .aspx
Source: https://habr.com/ru/post/898817/More articles:Formation of a dynamic programming algorithm for varying a knapsack problem - algorithmJustification of behavior overriding the value of val - overrideGrails / GORM: creating a one-to-one relationship - grailsnumpy.array image file "I; 16" - pythonSpring p namespace for args constructors? - javaWhy are some SQLite functions based on zero and some are sqliteVisual Studio Debugging Prevention with Explicit "Unhandled Exception" - multithreadingWPF Stack Panel Visibility Animation - visual-studio-2010Remote client computer for debugging - c #How to use members with standard (batch) or private access in REPL? - scalaAll Articles