C++/CLI Finalization of the Consolidation Annex
-
There's a function of Main. I can at any time complete the work of the annex by calling
return 0;
How am I supposed to do this from another function? I mean, even from a class function. So far, it's only come to cause an exception and to process it in the mein, calling it an exception.
return 0;
♪ Though I'm not sure it'll work. Like in the block. Catch You can't go back. Anyway, I don't like it.
-
In the block
catch
possible Recalate the meaning, so the option you've made will work.Besides, there's a library function. http://www.cplusplus.com/reference/cstdlib/exit/ from the standard library of C++.
Even if the library function https://msdn.microsoft.com/ru-ru/library/system.environment.exit(v=vs.110).aspx CLR
Finally, there's a function in WinAPI. https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms682658(v=vs.85).aspx
But in general, the exit from the program from where it came from is antipaththern. Perhaps you should reconsider the annex architecture.