4

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?

hellowahab
  • 2,445
  • 4
  • 21
  • 34

2 Answers2

3

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).

boj4n
  • 31
  • 3
2

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.

hellowahab
  • 2,445
  • 4
  • 21
  • 34