Connecting Tech Pros Worldwide Forums | Help | Site Map

Am I doing this correctly - exceptions!

Peter Strĝiman
Guest
 
Posts: n/a
#1: Nov 16 '05
I have this piece of code:

I have a class that represents an exception

class ResultmakerException
{
private:
std::wstring _errorMsg;
HRESULT _errorCode;
public:
ResultmakerException( const std::wstring &errorMsg, HRESULT errorCode =
E_FAIL )
{
_errorMsg = errorMsg;
_errorCode = errorCode;
}
~ResultmakerException(void);
....
std::wstring& get_ErrorMsg() { return _errorMsg; }
HRESULT get_ErrorCode() { return _errorCode; }
};

Later on I use the class

try
{

}
catch( ... )
{
}
void _Eos(size_type _Newsize)
{ // set new length and null terminator
_Traits::assign(_Myptr()[_Mysize = _Newsize], _Elem());
}



Closed Thread