Home › Forums › TWAIN Classic › problems with Twain and C#
- This topic has 2 replies, 3 voices, and was last updated 7 years, 9 months ago by C.H.
- AuthorPosts
Hello
I am new to TWAIN and I am have a bit of difficulty trying to understand how I can create a windows form the will allow my end users to scan documents using my windows form. I downloaded the zip files from the TWAIN web site and I copied the TWAINDSM.dll into my system 32 folder. I retrieved the TWAINDSM.dll from C:Usersrichard.reynoldsDownloadstwaindsm-2.3.0.win.bintwaindsm-2.3.0.win.bintwain64. When I opened a new project in Visual Studio and tried to make a reference to the TWAINDSM.dll I received the following error “A reference to ‘C:WindowsSystem32TWAINSM.dll could not be added. Please make sure the file is accessible, and that it is a valid assembly or COM component. I them opened the FormScan.cs to do some research and I noticed in the code that using TWAINWorkingGroupToolkit; is also causing an error.The TWAIN CS project is a C# interface to TWAIN drivers. It’s a single solution (four projects) that is built usually Visual Studio. I recommend running the scanning application. One you have the sample built and working you can examine the sample application to see how to access the TWAIN CD toolkit.
As for integrating with an existing C# project, you just need the toolkit cs module, and the twain cs and twainh cs modules. I recommend copying them into your project. Then, using the scanning sample as a template, copy over the code needed to initialize the toolkit. You’ll need the scan callback function, which is invoked for the images passing through the system, and that’s about it.
If you don’t mind using a commercial product, you can try Dynamsoft’s Dynamic .NET TWAIN or Atalasoft’s DotTWAIN. The cost is around $600. But it will save lots of time for you.
- AuthorPosts