2

I would like to obtain the serial number of a scanner in C# using twain_32.dll.
I've found out it has to be done with dscap method with the icap_serialnumber capability.

Can anyone give me an example how to do this?

Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
Hans V
  • 21
  • 2
  • 1
    I´m not really sure, but some of the code in this example http://stackoverflow.com/questions/13357297/is-it-possible-in-twain-to-force-a-scanner-to-set-the-region-to-the-entire-width may help you. – Tobias Nilsson Jan 09 '13 at 15:20
  • when i try the code, i get a failed as return code for the dsmparent statement. can any-one tell me why? – Hans V Jan 10 '13 at 14:18

1 Answers1

0

You have confirmed that your scanner driver supports this capability? I find it in the TWAIN spec as CAP_SERIALNUMBER (0x1024). And it is optional - you cannot assume that a scanner supports it.

If you get TWRC_FAILURE when you try to GET that capability, check the condition code. Your library or component should provide a way to get the condition code after the GET. A value of TWCC_CAPUNSUPPORTED would mean that the scanner driver does not support that capability. Other condition codes are described in the TWAIN specification, although sometimes a little imagination is needed to guess what the driver is trying to say...

The TWAIN Working Group forum is maybe a little better place for this kind of question.

Spike0xff
  • 1,246
  • 1
  • 15
  • 24