I have a problem about scanning.
if I have set a scanner preference before doing the scan (because i have a lot scanners and need to set a default's between them)
example:
I set my default scanner source name = TestScanner
this is part of my code in below
(
Code: Select all
Private defaultScannerName as string = "TestScanner"
Private Sub scanBackgroundWorker_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles scanBackGroundWorker.DoWork
Dim hwnd As IntPtr = IntPtr.Zero 'To enfore the TWAIN controler to create its own windows proxy in this SAME thread.
DevExpress.Data.CurrencyDataController.DisableThreadingProblemsDetection = True
Dim isInvalidStop As Boolean = False
If GDPictureImagingObj.TwainOpenSource(hwnd,defaultScannerName) Then
.......
.......
.......
END
THEN
GDPictureImagingObj.TwainOpenSource(hwnd,defaultScannerName) return False to me
I can use that code in normal situation , but cannot in backGroundWorker
*Note :
I need to set the default scanner before doing the scan , so i don't use the method about GDPictureImaging.TwainSelectSource()
Thank you for your reply