|
-
December 2nd, 2003, 04:46 AM
#1
How to suppress system error message?
If my program encounters a system error, how to prevent the system error message from being displayed?
-
December 2nd, 2003, 05:53 AM
#2
Use SetErrorMode(...) look it up on msdn.microsoft.com for the flags you may or may not want to set.
-
December 2nd, 2003, 06:53 AM
#3
you can use SEH __try{
}__except(EXCEPTION_CONTINUE_EXECUTION ){} for c code
or you can use c++ exception handling try{
}catch(...){} for c++ code
for egsample if u try the following code, you'll get a gpf
long* p = 0;
*p =10;
but if u try this
__try{
long* p = 0;
*p =10;
}__except(EXCEPTION_CONTINUE_EXECUTION ){
}
or this
try{
long* p = 0;
*p =10;
}catch(...){
}
the hard exception will be trapped and control will go to the __except or catch(...) block
hope this helps
-
December 2nd, 2003, 06:57 AM
#4
Originally posted by raghupathys
you can use SEH __try{
}__except(EXCEPTION_CONTINUE_EXECUTION ){} for c code
or you can use c++ exception handling try{
}catch(...){} for c++ code
for egsample if u try the following code, you'll get a gpf
long* p = 0;
*p =10;
but if u try this
__try{
long* p = 0;
*p =10;
}__except(EXCEPTION_CONTINUE_EXECUTION ){
}
or this
try{
long* p = 0;
*p =10;
}catch(...){
}
the hard exception will be trapped and control will go to the __except or catch(...) block
hope this helps
Better to use C++ exception handling and install a set_se_translator(...)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|