Smart Card APIs throw First Chance exceptions but program runs fine
Clash Royale CLAN TAG #URR8PPP Smart Card APIs throw First Chance exceptions but program runs fine INTRODUCTION I am learning how to use Smart Card API in order to obtain card number once it gets inserted into reader. So far I have managed to create a working application that runs (as far as I can see) without errors. PROBLEM During debugging I see various First chance exceptions, but every Smart Card API returns SCARD_S_SUCCESS and program never crashes nor exhibits any other erroneous behavior. SCARD_S_SUCCESS RELEVANT INFORMATION #include <Windows.h> #include <iostream> #include <iomanip> #include <winscard.h> #pragma comment(lib, "Winscard.lib") void f() // helper that transforms error code to meaningful message { LPSTR s = NULL; if (::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), s...