Click here to Skip to main content
15,908,274 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
How to forbid the ComException cause In C#.Thank you.
Posted
Comments
[no name] 9-Aug-12 12:29pm    
I would probably just tell it it was bad and make it stand in the corner. Maybe you meant to ask an actual question?
ZurdoDev 9-Aug-12 13:38pm    
There are those who prefer spanking over time-out. Hard to tell what would work in this case.
[no name] 9-Aug-12 14:10pm    
Yeah but then you get some bleeding heart liberals going off and whining about exception abuse....
Sergey Alexandrovich Kryukov 9-Aug-12 13:50pm    
My 5!
--SA
[no name] 9-Aug-12 14:11pm    
<bow> :-)

1 solution

C#
try
{
    //here comes your code which could raise a COMException
}
catch(COMException ex)
{
    //do something useful with that Exception,
    //e.g. show a message to the user, and then clean-up
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900