Code: Select all
int main(int argc, char* argv[])
{
try
{
// program code goes here
}
catch ( ... )
{
// default exception handler goes here
}
}
Also, is there any advantage to using the [tt]TRY[/tt]/[tt]CATCH[/tt] macros instead of the built-in [tt]try[/tt]/[tt]catch[/tt] expressions?
Finally, is there any reasonable way to compile an AppWiz-generated program using another compiler (specifically, MingW gcc 3.2 run from Dev-C++) without modifying the code to such an extent that it would no longer work with VC++? This is not a critical task, but I prefer to check programs with another development environment whenever possible, as a way of highlighting problems which the original compiler might have missed.
Please bear with me if I seem to have any obvious misconceptions about MFC and AFX; I have, up until now, largely avoided them, as they seemed more complicated than they were worth (even compared to the bare Win32 API). When I first read about it years ago, my impression was that it is an excellent example of how not to design a GUI object API, and I have yet to see anything that would convince me otherwise (though in all fairness, I have yet to see what I would consider to be a good GUI API for C++ under any system).
Since I will doubtless have to do more C++ MFC programming in the future, I would like to finally learn it, but so far it has been quite aggravating (I've been told that after working with it for a coule of months it will make perfect sense, but I'm not sure I believe it). Any elucidation or advice (including web pointers and book recommendations) would be helpful.