TwainAcquireToGdPictureImage Hanging
TwainAcquireToGdPictureImage Hanging
Hi,
You may have noticed that i've already posted an issue a few minutes earlier regarding Multithreading, As this problem appears to be different i thought i'd make a seperate post for it.
I can run your .NET sample (twain_sample) absolutely fine. Unlike my earlier post there is NO multithreading in place here as i thought i'd continue to develop while i'm waiting for an answer to my earlier post.
In your sample i hit 'Command3_Click', the Scanner is opened successfully (Epson GT15000), the resolution is set and UI is hidden, TwainAcquireToGdPictureImage is then run. This then causes my scanner to start - No problems here.
However, when i move the EXACT same code into my development application (literally cutting and pasting!) then the scanner does not work. When TwainAcquireToGdPictureImage is called it simply blocks and does not return.
You may think that the references are not correct but i've referenced the version of GDPicture.Dll in the GAC that the sample is using and I also know the dll is working as it has produced a log file that shows GDPicture apparently stuck in a loop?
When i close the MDIChild window the dispose event is called on the usercontrol, the .TwainUnloadSourceManager is called. At this point, the TwainAcquireToGdPictureImage method stops blocking and returns an imageID of 0.
The only thing that is different is that i'm running a MDI form with a MDI Child form inside it, this form then houses a usercontrol and then that usercontrol has another usercontrol inside it that provides a scanning interface to the user. I'm not sure if this would make a difference?
I've also tried using different handles (MDI Parent.handle, Usercontrol.handle etc) and also IntPtr.ZERO but nothing makes any difference.
EDIT: I cannot upload my log file as your website keeps saying 'The extension log is not allowed.' I've tried changing it to .dat, .abc but the same error.
Basically the line below keeps looping over:
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
You may have noticed that i've already posted an issue a few minutes earlier regarding Multithreading, As this problem appears to be different i thought i'd make a seperate post for it.
I can run your .NET sample (twain_sample) absolutely fine. Unlike my earlier post there is NO multithreading in place here as i thought i'd continue to develop while i'm waiting for an answer to my earlier post.
In your sample i hit 'Command3_Click', the Scanner is opened successfully (Epson GT15000), the resolution is set and UI is hidden, TwainAcquireToGdPictureImage is then run. This then causes my scanner to start - No problems here.
However, when i move the EXACT same code into my development application (literally cutting and pasting!) then the scanner does not work. When TwainAcquireToGdPictureImage is called it simply blocks and does not return.
You may think that the references are not correct but i've referenced the version of GDPicture.Dll in the GAC that the sample is using and I also know the dll is working as it has produced a log file that shows GDPicture apparently stuck in a loop?
When i close the MDIChild window the dispose event is called on the usercontrol, the .TwainUnloadSourceManager is called. At this point, the TwainAcquireToGdPictureImage method stops blocking and returns an imageID of 0.
The only thing that is different is that i'm running a MDI form with a MDI Child form inside it, this form then houses a usercontrol and then that usercontrol has another usercontrol inside it that provides a scanning interface to the user. I'm not sure if this would make a difference?
I've also tried using different handles (MDI Parent.handle, Usercontrol.handle etc) and also IntPtr.ZERO but nothing makes any difference.
EDIT: I cannot upload my log file as your website keeps saying 'The extension log is not allowed.' I've tried changing it to .dat, .abc but the same error.
Basically the line below keeps looping over:
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
-------------------
::DS operation. DG: DG_CONTROL - DAT: DAT_EVENT - MSG: MSG_PROCESSEVENT ->RC: TWRC_NOTDSEVENT CC: TWCC_SUCCESS // TWmsg: 0
Re: TwainAcquireToGdPictureImage Hanging
Hi,
To investigate your issue we need some other information. Please check this thread (we need everything described in it): viewtopic.php?t=1486
Also, we need a basic application reproducing the problem. When you have everything, just create a support case at https://www.gdpicture.com/support/getting-support-from-our-team & we will review the problem in priority.
Kind regards,
Loïc
It is probably the reason of the hanging. The problem can come from many things...The only thing that is different is that i'm running a MDI form with a MDI Child form inside it, this form then houses a usercontrol and then that usercontrol has another usercontrol inside it that provides a scanning interface to the user. I'm not sure if this would make a difference?
To investigate your issue we need some other information. Please check this thread (we need everything described in it): viewtopic.php?t=1486
Also, we need a basic application reproducing the problem. When you have everything, just create a support case at https://www.gdpicture.com/support/getting-support-from-our-team & we will review the problem in priority.
Kind regards,
Loïc
Re: TwainAcquireToGdPictureImage Hanging
Ok ... I've submitted a support ticket.
Thanks for your help
Thanks for your help
Re: TwainAcquireToGdPictureImage Hanging
Hey there
I'm having exactly the same problem however, I'm not using a MDI window.
The application has one form that renders a couple of components such as a toolstrip and some panels. Also a default PDF file is loaded into the Viewer in the form_load event. The program starts fluently. Problems occur when I click the Scan button.
INFO:
- GdPicture.NET Document Imaging SDK Ultimate (32-bit & 64-bit)
- Device: Fujitsu fi-6130, TWAIN Driver: TWAIN version 1.9
- OS: Windows 7 Professional
Sample This is the code that is executed when I press the scan button. It is kept as simple as possible.
- Log file contains the same info as the one from Gone2mars
I'm having exactly the same problem however, I'm not using a MDI window.
The application has one form that renders a couple of components such as a toolstrip and some panels. Also a default PDF file is loaded into the Viewer in the form_load event. The program starts fluently. Problems occur when I click the Scan button.
INFO:
- GdPicture.NET Document Imaging SDK Ultimate (32-bit & 64-bit)
- Device: Fujitsu fi-6130, TWAIN Driver: TWAIN version 1.9
- OS: Windows 7 Professional
Sample This is the code that is executed when I press the scan button. It is kept as simple as possible.
Code: Select all
Dim image As Integer
With pictureImaging
If .TwainOpenSource(Me.Handle, deviceSource) Then
.TwainSetHideUI(True)
.TwainSetAutoFeed(True) ' Try to enable or disable the Source’s automatic document feeding process.
.TwainSetAutoScan(True)
.TwainSetPixelType(TwainPixelType.TWPT_RGB) 'RGB
.TwainSetBitDepth(8)
image = .TwainAcquireToGdPictureImage(Me.Handle)
.TwainCloseSource()
.TwainLogStop()
If image <> 0 Then
pictureViewer.DisplayFromGdPictureImage(image)
End If
pictureViewer.Focus()
End If
End With
Last edited by BenV on Tue Dec 14, 2010 6:04 pm, edited 1 time in total.
Re: TwainAcquireToGdPictureImage Hanging
Hi,
I just posted a code snippet for asynchronous scanning. See: viewtopic.php?t=2861
If you still have a problem you have to send a standalone application which reproduce the problem at https://www.gdpicture.com/support/getting-support-from-our-team
kind regards,
Loïc
I just posted a code snippet for asynchronous scanning. See: viewtopic.php?t=2861
If you still have a problem you have to send a standalone application which reproduce the problem at https://www.gdpicture.com/support/getting-support-from-our-team
kind regards,
Loïc
Re: TwainAcquireToGdPictureImage Hanging
Thanks for the VERY quick reply Loic.
I copied over your code and this is what I get:
I never was a big hero when it comes to multithreading, so I guess I'll start making an account on your support site .
I copied over your code and this is what I get:
Code: Select all
Cross-thread operation not valid: Control 'ScanTool' accessed from a thread other than the thread it was created on.
Re: TwainAcquireToGdPictureImage Hanging
Hey, it's me again. I've managed to get the scanner working with the background worker but only one time. So it scanned only one paper. When I press "scan" again, I get this exception:
Shutting down both application and printer doesn't work.
[EDIT] I'm using GdPicture 7.3 btw
The message specified by the exception is:
Code: Select all
A first chance exception of type 'System.AccessViolationException' occurred in GdPicture.NET.dll
[EDIT] I'm using GdPicture 7.3 btw
The message specified by the exception is:
Code: Select all
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Re: TwainAcquireToGdPictureImage Hanging
Hi,
OK. Please send application reproducing the problem to https://www.gdpicture.com/support/getting-support-from-our-team.
Kind regards,
Loïc
OK. Please send application reproducing the problem to https://www.gdpicture.com/support/getting-support-from-our-team.
Kind regards,
Loïc
Re: TwainAcquireToGdPictureImage Hanging
I was wondering, are you guys still busy fixing this issue? I've opened a ticket on your support site as you asked but it keeps sending me emails saying I didn't reply on suggestions and the ticket will be closed. As you can see in the ticket's conversation history, I did reply, so the site had no reason to close it. I'll open the ticket (8027) once more and hopefully you'll pick it up again.
Re: TwainAcquireToGdPictureImage Hanging
Hii Ben,
We just gave you a reply on this.
Kind regards,
Loïc
We just gave you a reply on this.
Kind regards,
Loïc
Re: TwainAcquireToGdPictureImage Hanging
We're you able to resolve this BenV? I've seen the same thing.
Re: TwainAcquireToGdPictureImage Hanging
Hello All,
I'm facing the same problem of "TwainAcquireToGdPictureImage Hanging", Did anybody reach the solution for this problem?
please advice.
Best regards,
I'm facing the same problem of "TwainAcquireToGdPictureImage Hanging", Did anybody reach the solution for this problem?
please advice.
Best regards,
Re: TwainAcquireToGdPictureImage Hanging
Please guys understand that almost each TWAIN problem is unique. So stop to reply this thread and follow instructions described here to provide needed info to our staff: viewtopic.php?t=1486
I will lock this topic now.
Thank you for your cooperation.
Loïc
I will lock this topic now.
Thank you for your cooperation.
Loïc
Who is online
Users browsing this forum: No registered users and 1 guest