![Ubisys 7047 Reference Manual Download Page 45](http://html2.mh-extra.com/html/ubisys/7047/7047_reference-manual_3150151045.webp)
45
www.ubisys.de
9.2.6.2.
Methods
static
const
char
* GetErrorCauseStr(
const
unsigned
int
nErrorCause);
Translates the enumerated error codes (c.f. 9.2.6.1) to a user-readable string.
static unsigned int
MapErrorCause(
const long
lRet);
Translates the most common error codes returned by the Smart Card API to the enumerated error
codes (c.f. 9.2.6.1)
static
void
Throw(
long
lRet,
const
std::string &strOp =
""
);
This function is invoked internally to throw an exception.
strOp
determines the operation (e.g. API
call) which failed.
lRet
specifies the return value of the API function. Its value is internally translated
to one of the enumerated error codes. This information is passed to the function ThrowImpl().
static
void
ThrowImpl(
const
unsigned
int
nErrorCause,
long
lRet,
const
std::string &strOp);
User-/application-defined function, which actually throws the exception and eventually determines
the type of exception to throw.
Two default implementations are provided (c.f. 9.2.7).
9.2.7.
Pre-defined Exception Classes
SCardException.h and SCardException.cpp contain two pre-defined exception classes and the
corresponding implementation of CSmartCardExceptionHelper::ThrowImpl().
Per default, the class CSmartCardExceptionStd will be declared and defined, which derives from
std::exception. CSmartCardExceptionHelper::ThrowImpl() throws the exception by value.
By defining the pre-processor macro
SCARD_USE_MFC_EXCEPTIONS
, the alternative class
CSmartCardExceptionMFC is declared and defined.
The method CSmartCardExceptionHelper::
ThrowImpl() will throw allocate the exception on the heap and construct it by calling the new operator.
A pointer to the exception will be thrown.
9.2.7.1.
Common Data Fields
Both predefined exception classes contain the following public const data fields:
const
unsigned
int
m_nErrorCause;
Contains the cause of the error, encoded by using the enum defined in
CSmartCardExceptionHelper.
Summary of Contents for 7047
Page 1: ...13 56 MHz RFID USB READER REFERENCE MANUAL...
Page 28: ...28 www ubisys de...
Page 34: ...34 www ubisys de...