WIA Twain C # Support

How can I use WIA and Twain in C #? TWIAIN / C # example, found at http://www.codeproject.com/KB/dotnet/twaindotnet.aspx Throws an exception on line 59 on TwainLib.cs "An attempt was made to load a program using the wrong format." on Vista 64.

I would use WIA, but it does not have support for all the devices that I want to use.

Is there an easy way to enable TWAIN support in WIA in C #? I know that this can be done, but I cannot find documentation on this. I am not looking for a commercial product. I can understand how to use WIA just fine, but it is a fact that I cannot enable TWIAN support, which is annoying.

Examples are also welcome in C ++ / CLI or VB.net.

Thanks.

EDIT

Thank you cristianlibardo. You helped me a lot and I can just keep using TWIAN. But I still want to use WIA; therefore, I will not accept your answer. Here is some more info for people who just see this post. In response to this answer, everything:

Yup, it did it to support TWIAN; thank you I still want to use WIA; but now I have something to work with. However, when I select my USB camera as the source and click β€œpurchase,” the application freezes. My camera works with other commercial TWIAN applications.

Commenting on lines 100 though 104 (code that checks to see if there is "DScap (appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap)", returns TwRC.Success, now my camera works. I have no idea I have what this code does, since the documentation does not correspond to this question.

OK its constant is called "CAP_XFERCOUNT", which has something to do with scanning multiple images per session. Makes a session so that the camera does not support it.

+4
source share
1 answer

Probably a long shot, but you have a tried building with x86 as a platform or with a change in the state of the apartment?

+4
source

All Articles