I am trying to connect a smart card reader using following code
retCode = ModWinsCard.SCardConnect(hContext, cbReader.SelectedItem.ToString(), ModWinsCard.SCARD_SHARE_SHARED, ModWinsCard.SCARD_PROTOCOL_T0 | ModWinsCard.SCARD_PROTOCOL_T1, ref hCard, ref Protocol);
But it is always returning some error code. First it was returning 6 after changing the target platform to x86 now it is returning -2146434967.
Any idea why its behaving so?