From: Hans H. <ha...@2h...> - 2006-02-06 19:11:33
|
Reposting to the minw list. 'd like to mention that I have a try/catch block in the offending app's main() that is intended to handle EVERY error/exception encountered. thx, H. Brian Dessent wrote: > Hans Horn wrote: > >> I have an app build with gcc -mno-cygwin, that constantly bombards >> me with error dialogs as shown in the attachment. >> The app is meant to run non-interactively. >> Is there a way to compile the app differently so error notifications >> get simply printed out rather than being presented via dialog? > > First of all, you're using the mingw compiler when you use > -mno-cygwin, so you should ask on the mingw list. This has little to > do with Cygwin. > > But I don't think there's a lot you can do about this other than > obviously fixing your bugs that are causing the faults. When you use > mingw you are using the Microsoft C runtime library (MSVCRT) and it > sets up its the fault hander which is what is showing the above > dialog. So I don't think you have any control in that aspect. > > I suppose you could try installing your own handler in the SEH chain > that would catch the access violation and handle it in some way. If > you were using MSVC you could just use _try/_except but unfortunately > gcc does not support this, so you would have to do it manually. (Is > there a set of macros out there somewhere that eases this?) You'll > have to consult MSDN or google for more details there, not exactly on > topic for this list since Cygwin does exception handling in the posix > way. A starting point is > <http://www.microsoft.com/msj/0197/Exception/Exception.aspx>. > > Brian |