| title | CAtlException Class | Microsoft Docs | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||
| ms.reviewer | ||||||||||||||
| ms.suite | ||||||||||||||
| ms.technology |
|
|||||||||||||
| ms.tgt_pltfrm | ||||||||||||||
| ms.topic | reference | |||||||||||||
| f1_keywords |
|
|||||||||||||
| dev_langs |
|
|||||||||||||
| helpviewer_keywords |
|
|||||||||||||
| ms.assetid | 3fd7b041-f70d-4292-b947-0d70781d95a8 | |||||||||||||
| caps.latest.revision | 19 | |||||||||||||
| author | mikeblome | |||||||||||||
| ms.author | mblome | |||||||||||||
| manager | ghogen | |||||||||||||
| translation.priority.ht |
|
This class defines an ATL exception.
class CAtlException
| Name | Description |
|---|---|
| CAtlException::CAtlException | The constructor. |
| Name | Description |
|---|---|
| CAtlException::operator HRESULT | Casts the current object to an HRESULT value. |
| Name | Description |
|---|---|
| CAtlException::m_hr | The variable of type HRESULT created by the object and used to store the error condition. |
A CAtlException object represents an exception condition related to an ATL operation. The CAtlException class includes a public data member that stores the status code indicating the reason for the exception and a cast operator that allows you to treat the exception as if it were an HRESULT.
In general, you will call AtlThrow rather than creating a CAtlException object directly.
Header: atlexcept.h
The constructor.
CAtlException(HRESULT hr) throw();
CAtlException() throw();
hr
The HRESULT error code.
Casts the current object to an HRESULT value.
operator HRESULT() const throw ();
The HRESULT data member.
HRESULT m_hr;
The data member that stores the error condition. The HRESULT value is set by the constructor, CAtlException::CAtlException.