Author Topic: TwainLib in VB.NET  (Read 1346 times)

acaball1

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
TwainLib in VB.NET
« on: January 21, 2016, 11:37:56 PM »
I just downloaded TwainLib version 3. I opened the example in Visual Studio and it works great!
However, I'd like to make an application from scratch. How do I add all the libraries and references required? Do I need to place the TwainLib.dll in some particular folder?

mkaatr

  • Administrator
  • Full Member
  • *****
  • Posts: 115
  • Karma: +1/-0
    • View Profile
Re: TwainLib in VB.NET
« Reply #1 on: February 21, 2016, 01:39:54 PM »
Hi there...

1- copy the DLL, and add it to your project.
2- add a reference to the DLL
3- use the code in your project. It should work just fine.

yours sincerely

ptclabs

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
TwainLib in VB.NET
« Reply #2 on: April 22, 2016, 11:20:01 AM »
I have been playing with version 2 and version 3. For me they both give me the same problem. It has an access violation when it calls         CloseSrc() in both versions. I origanlly had a program written in .net2.0. I noticed the dll was in 3.5, so I bumped it up to that without any help.

any ideas?

This is an x86 application I was using it on, but may try with a new x64 to see if that is the problem

ptclabs

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: TwainLib in VB.NET
« Reply #3 on: April 23, 2016, 12:30:14 AM »
I tried a new 64bit application it still has problems
it is showing one of the dependancies not being loaded

this is in vs2015
00007FF94B611545  nop

I tried again to trackdown the problem code in x86 it has a memory access violation here

                ' tell the device manager to release the source
                'rc = DSM_Ident(appid, IntPtr.Zero, TwDG.TwDG_Control, TwDAT.TwDAT_Identity, TwMSG.TwMSG_CloseDS, SelectedDataSource)

commenting out the line made it acquire an image, but it will not acquire more than one from the document feeder.
« Last Edit: April 23, 2016, 01:11:57 AM by ptclabs »