Writing a Smart Card Library - The CRegListDlg Class
(Page 4 of 5 )
This class just presents a UI (user Interface) to select a reader from the installed readers. The readers displayed in this selection dialog are picked from the registry settings displayed above (Figure 2). For a snapshot of this UI element refer to figure 5.
You can modify the code to display the readers from an entirely different location or even an ini file. It's solely dependent on the requirements one may have. But as Microsoft implements t this way I thought it'd be better if I stick to the registry.

Figure 5: The CPCSCCommand class and Members
The CPCSCCommand Class
This class encapsulates an APDU object. That is it takes care of the data sent and received from the card. Although I've provided a CString override of the SendCommandToCard() method but I'd recommend using the CPCSCCommand class.
The members with the prefix m_ are the actual data units that constitute the APDU and the remaining methods just set or retrieve them. The code for this class is straightforward and you can take a look to get a better understanding.
Next: The Demo Application: SCardDemo >>
More C++ Articles
More By Digvijay Chauhan