本文整理汇总了C++中CCard::Disconnect方法的典型用法代码示例。如果您正苦于以下问题:C++ CCard::Disconnect方法的具体用法?C++ CCard::Disconnect怎么用?C++ CCard::Disconnect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCard
的用法示例。
在下文中一共展示了CCard::Disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Disconnect
void CReader::Disconnect(tDisconnectMode disconnectMode)
{
m_oPKCS15.Clear(NULL);
if (m_poCard != NULL)
{
// Strange behaviour with Ctrl-C:
// It's possible that this function is called multiple times. Normally,
// this doesn't hurt except that after a Ctrl-C, m_poCard->Disconnect()
// throws us out of this function WITHOUT an exception! So the m_poCard
// is not deleted() and set to NULL allthough the next call to this function
// it contains rubbisch => CRASH.
// So we set m_poCard = NULL in advance, and only if an exception is thrown
// we assign it the old value.
CCard *poTemp = m_poCard;
m_poCard = NULL;
try {
poTemp->Disconnect(disconnectMode);
MWLOG(LEV_INFO, MOD_CAL, L" Disconnected from card in reader %ls",
m_wsReader.c_str());
delete poTemp;
}
catch(...) {
m_poCard = poTemp;
}
}
}