Reference » Global functions » MHandleException

Elgrint::MHandleException(int,MString,MString) function

Declaration (see elgrint.cpp):

void MHandleException(int code, const MString& title, const MString& message);


Called internally to report an exception. Part of the Elgrint exceptions mechanism.


Name Type Description
code int

Numeric identifier of the exception (always greater than 1999).

title MString

Generated based on the code's first digit.

message MString

Text based on exception's definition (see MApp::defineException) and string parameters of GenException.


This function implements the final stage of exception processing, started by the GenException function. It is defined in the elgrint.cpp file, which should be added to compilation if the default implementation is sufficient. If the app contains just one file, it can be more convenient to include elgrint.cpp instead of elgrint.h (compilation configuration doesn't need to change in this case).

By default, MHandleException calls the MApp::messageBox function for all exceptions, except that 3001 and 4001 are ignored in RELEASE mode. The app windows remain enabled (disableApp parameter of MApp::messageBox is false) to avoid an "app freeze" if the exception is generated repeatedly due to an error in app design.

This behavior can be altered by defining a custom MHandleException, simply by writing a new body for it in your app. Of course, in such a case, the elgrint.cpp file cannot be included to compilation or the linking will fail due to duplicate definition.



Let us know

Please Contact us to report any errors on this page, or to suggest any improvements.

Miranor Home | About Miranor | About Elgrint | Create account | Login | Account settings | Contact Us | Privacy Policy | Site map

© Copyright 2014 by Miranor. All rights reserved. By using this site you agree to the Terms of Use.

Page last updated on August 10th, 2014.