We help IT Professionals succeed at work.

General Exception class???

h_himmat
h_himmat asked
on
Hi There!!!!
    Can any one tell me that how to develop an general exception class which will handel all the exception in VC++...........



Thanx
Comment
Watch Question

Commented:
No such thing as an exception /handling/ class that can handle all exceptions. Exceptions are, as their name implies, used in exceptional cases, that is, wherever a piece of code (yours or OS') encounters a situation it can not handle.

You can have a generic exception class to be used for /throwing/ exceptions. Such a class could do usefull things (display messages, log exception info, etc)

Commented:
Just to throw in a different view point, exceptions are useful as more than just the cases the program can handle.  Though this really has nothing to do about your problem, so onto some useful tidbits:

- Any type can be used as an exception.  For fun, try throwing things like ints or strings.  However, this prevents a general exception class to handle all exceptions.

- There is a relatively simple exception class in the standard library that has some useful things in it.  Unfortunately, support for the standard library is a little sketchy in VC++, so I can't guarantee that it would be entirely there.  Look in <exception> for the actual class.

- On the receiving end, use the elipsis (...) to catch any otherwise uncaught exception.

Commented:
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "Kangaroo" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: http://www.experts-exchange.com/commspt

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner

Author

Commented:
the poblem has has been solved by me only...........

Thanx for your support.....
Per recommendation, force-accepted
Netminder
CS Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.