TwainOpenDefaultSource(Me.Handle) Visual Basic

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
siben
Posts: 1
Joined: Mon May 06, 2013 11:11 pm

TwainOpenDefaultSource(Me.Handle) Visual Basic

Post by siben » Mon May 06, 2013 11:26 pm

Using .NET Version 3.5

Followed Steps 1 & 2

1. Summary

After installation, we recommend you to have a look at the samples directory to get some featured examples of the GdPicture.NET usage. (Didn't view Samples)

Notes:
To install the GdPicture.NET suite on client computers, please see the "Redistributing GdPicture.NET" section.
GdPicture.NET requires the .NET Framework 2.0 or higher.
GdPicture.NET core is compiled using the AnyCPU Platform target.

2. Adding a reference to GdPicture.NET into your application.
Start Visual Studio .NET

Begin a new project using your favorite programming language.

Select Project / Add Reference...

Select the Browse tab and select the GdPicture.NET dll library which can be found on C:\Program Files\GdPicture.NET 9\Redist\Framework X.X\GdPicture.NET.dll

Add a link to the GdPicture Namespace where you want to use the DLL
In VB.NET, add the appropriate Imports directive to the code file where you want to use the DLL: "Imports GdPicture9"

Using Visual Basic

<code>
Imports GdPicture9

Public Class MyImages

Private Const myKey As String = "XXXX"

Private oGdPictureImaging As GdPictureImaging

Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.

'/* Set License Key
Dim m_LicenseManager As New LicenseManager
Dim _success As Boolean = m_LicenseManager.RegisterKEY(myKey)
If Not _success Then
MessageBox.Show("License manager failed RegisterKEY() Function", "Error", MessageBoxButtons.OK)
End If

End Sub

Private Sub ScanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ScanToolStripMenuItem.Click

oGdPictureImaging = New GdPictureImaging

oGdPictureImaging.TwainOpenDefaultSource(Me.Handle)

End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub

End Class
</code>

I get the error :
Can't find GdPicture.NET.9.twain.client.dll. Please, copy last version of this dll into your application directory at: C:\Windows\assembly\GAC_MSIL\GdPicture.NET.9\9.4.0.7__c2b5d9102a68ce40

I have some familiarity with TWAIN coded my own library (minute)....

Have TWAINDSM.dll located in the (C:\Windows\System32\) Directory... whats wrong??

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: TwainOpenDefaultSource(Me.Handle) Visual Basic

Post by SamiKharma » Tue May 07, 2013 9:10 am

Hi,

I am not sure I understand correctly what you did, but from the error, I can see that you did not include our twain dll named (GdPicture.NET.9.twain.client.dll) in your application directory, in your post, you posted a part of our documentation, here it is:
Notes:
To install the GdPicture.NET suite on client computers, please see the "Redistributing GdPicture.NET" section.
Please do refer to that here:
https://www.gdpicture.com/guides/gdpicture/v9/html/con ... e_NET.html
so you can see what dlls you need to include in your app depending on what kind of app it is.

NOTE: You need to have that dll in the same location as the GdPicture.NET.9.dll you are referencing in your application

I hope this helps,
Best,
Sami

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest