[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2517
  • Last Modified:

How do I use twain_32.dll in Visual C#.NET 2008

I need to scan something using Visual C#.NET 2008.  From what I've seen it looks like twain_32.dll might be the way to go.  I found a post on that here.

http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_24904738.html?sfQueryTermInfo=1+c+net+scan+twain#notices

But I don't know how to use that.  I need some good code samples as far as how to set that up.  I've tried using the twain example on CodeProject.com.  That crashes when I try to run the project.  

I will need to convert the scanned documents to PDFs down the line so any info on that would be appreciated as well.

Thanks
0
Ameronix
Asked:
Ameronix
  • 7
  • 3
1 Solution
 
käµfm³d 👽Commented:
Can you describe where it crashes?
0
 
AmeronixAuthor Commented:
I press play and it immediately says vshost.exe has stopped responding.  It never even starts up.
0
 
käµfm³d 👽Commented:
Can you confirm the steps you took to run the project? It's been a while since I messed with this project, but if I remember correctly:

  • Download the project (of course)
  • I believe the project was created in 2003 edition, so a conversion is required
  • Confirm that you have the TWAIN dll's installed on your system.
    • You can even go the TWAIN website (http://www.twain.org) to download the most current dll's, but this shouldn't be necessary
  • Make sure you have a scanner attached/accessible (of course)
  • If the above are in order, then you should just be able to execute the project, and then go to File->Select Source to pick your scanner
I downloaded the project just now and performed the conversion. I was able to execute the application without incident. I do not have a scanner available, though, so I can validate the Select Source portion, but last time I used it, there was no issue.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
käµfm³d 👽Commented:
>>  ... so I can validate the Select Source portion ...

so I can not validate the Select Source portion
0
 
AmeronixAuthor Commented:
As dumb as it sounds I don't have a scanner hooked up at the moment.  I'm trying to figure out how it all works and just wanted to look at the application.  Would not having a scanner cause it to crash though?  Where do I confirm the TWAIN dlls?
0
 
käµfm³d 👽Commented:
P.S.

This was my first assigment at my current job, so I had a BLAST (sarcasm) with it. I did not get to finish working on it as the higher ups put it on the back burner for another higher priority issue, but I'll be glad to offer any assistance I can in working with the TWAIN and .NET.

Even in not finishing the project, I did get it to a point where it was stably scanning documents using the auto feeder.

As far as the converting to PDF, I have not worked on anything (yet) of this nature, so I can be of little assistance here. A quick search turned up another CodeProject article: http://www.codeproject.com/KB/files/imagetoPDF.aspx
0
 
käµfm³d 👽Commented:
The TWAIN dll's are located at:

    C:\WINDOWS\twain.dll
    C:\WINDOWS\twain_32.dll

Of course, substitute the appropriate drive letter if your system doesn't use "C".
0
 
käµfm³d 👽Commented:
The Code Project article (and the code I worked with) were written using the older implementation of TWAIN (pre- 2.1). If you want to stick with that project and you are going to download anything from the TWAIN site, then make sure you go the Downloads page and scroll down to the "Data Source Manager" section. Under this section, select the data source manager that is listed under the heading "Older Windows DSM".
0
 
AmeronixAuthor Commented:
It's starting to look like I'll have to use Accusoft's ImagXpress.  I don't suppose you know anything about that?
0
 
käµfm³d 👽Commented:
No Sorry.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 7
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now