This Visual C++ project impliments a simple class called SCardManager. This class defines routines for all of the major
PC/SC functions and does error checking for each. This class also has member variables to store the PC/SC reader list
and a routine to convert PC/SC error codes into text representations.
Class Variables:
| m_SCardEstablishContext |
a wrapper around it's PC/SC counterpart SCardEstablishContext
this is the first call made when setting up PC/SC communication. We call this function on object creation.
For more information on SCardEstablishContext, options and return values please see the MSDN documentation for SCardEstablishContext
|
| m_SCardListReaders |
a wrapper around it's PC/SC counterpart SCardListReaders
this fuction gets a list of PC/SC readers from the PC/SC Resource Manager and initializes our member variable
m_csReaderList.
For more information on SCardListReaders please see the MSDN documentation for SCardListReaders
|
| m_SCardConnect |
a wrapper around it's PC/SC counterpart SCardConnect
this function takes the user selected reader string and opens a connection. We use some basic
options for this function SCARD_SHARE_SHARED means this application is willing to share the card
with other applications, and the SCARD_PROTOCOL* list is just letting the resource manager know
what protocols we will accept. For a complete list of options please see the MSDN documentation for SCardConnect.
|
| m_SCardReleaseContext |
a wrapper around it's PC/SC counterpart SCardReleaseContext
this function lets the PC/SC resource manager know that we are done acessing the reader and frees
up any smart card contexts he had established. This call should always be made if an SCardEstablishContext
has succeeded and hence we put it in our object destructor. For more information please see the
MSDN Documentation for SCardReleaseContext
|
| m_GetPCSCErrorString |
This function takes a PC/SC error code (LONG) and returns a string representation of that error code.
Very useful for debuggin.
|
| M_FillReaderComboBox |
This function takes a pointer to a dialog combobox and fills it with readers from the member object
m_csReaderList.
|
| |
|