> You can use SetLastError and GetLastError, but I don't
> suggest them. I suggest you just feed an error code into the
> exception, like:
>
> enum ExceptionCode
> {
> // ...
> };
>
> class Exception
> {
> public:
> Exception(ExceptionCode code)
> : m_code( code )
> {
> }
>
> ExceptionCode GetCode() const
> {
> return m_code;
> }
>
> private:
> ExceptionCode m_code;
> };
>
> void parser_internal()
> {
> if (something_bad())
> {
> throw Exception( theErrorCode );
> }
> }
>
> void parser_external()
> {
> try
> {
> parser_internal();
> }
> catch (Exception & ex)
> {
> ExceptionCode = ex.GetCode();
> // do something with it
> }
> }
Would this exception class be derived from CException?
Would I have to "delete" the exception when caught?
Andrew
This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.
_______________________________________________
msvc mailing list
[EMAIL PROTECTED]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription
changes, and list archive.