You shouldnt really throw when there are other options, error handling is
expensive. Why not just have this:
if ((cx != 0) || (cy !=0)) {
TrueOrFalseZeroRect = false;
} else {
TrueOrFalseZeroRect = true;
return ;}
Its the better option, surely?
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"raylopez99" wrote:
> On Jul 6, 3:55 pm, "Ben Voigt [C++ MVP]" <r...@nospam.nospam> wrote:
>
> > Well, you were outside the try/catch when you threw an exception, so it will
> > hit the OS and do very bad things. Why not show your MessageBox and return
> > immediately instead of throwing?
> >
>
> Thanks Ben Voigt! Indeed, simply placing the 'throw' * inside the
> 'try' block solved the problem.
>
> And if you comment out the exception handling, it solves the problem
> with no distraction to the user (since a minimized window is not
> really an error)
>
>
> RL
>
> * this code:
> if (TrueOrFalseZeroRect)
> {
> // MessageBox.Show("zero_area1!");
> throw new ArgumentException("zero area!");
> }
>