Reputation: 2485
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?
Upvotes: 4
Views: 9358
Reputation: 31
Same code, returning 6 instead of 0.
Setting card on reader did not help until I did not change build option to x86.
Thank You for posting that changing target platform returned -2146434967 (0x80100069 - SCARD_W_REMOVED_CARD).
Upvotes: 3
Reputation: 2485
Just for other to benefit:- This was due to the removal of tag from the reader.
You can keep you tag placed on the reader this error will get removed.
Upvotes: 2