Tattakashi123 / t

Automatically exported from code.google.com/p/twaindotnet
0 stars 0 forks source link

Application "Test App" not responding when click on cancel button on twain UI #13

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.run Test App
2.Check "Use UI" checkbox
3.Click Scan Button
4.twain scan dialog shown, click on cancel button

What is the expected output? What do you see instead?
Expected output: Test app must return to it normal state.
Instead: Test app not responding.

What version of the product are you using? On what operating system?
1.0.3516

Please provide any additional information below.

Original issue reported on code.google.com by ayman1...@gmail.com on 6 Apr 2010 at 1:54

GoogleCodeExporter commented 8 years ago
i have the same problem
cancel and the window close button do not respond on the twain scanner native 
settings UI

Original comment by wgtm.pet...@gmail.com on 9 Sep 2010 at 11:57

GoogleCodeExporter commented 8 years ago
Bug confirmed in the source.

Class: DataSourceManager
Method: FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref 
bool handled)

Should handle the Message MSG_CLOSEDSREQ and close the DataSource!

Current Implementation:
            switch (_eventMessage.Message)
            {
                case Message.XFerReady:
                    Exception exception = null;
                    try
                    {
                        TransferPictures();
                    }
                    catch (Exception e)
                    {
                        exception = e;
                    }
                    finally
                    {
                        EndingScan();
                        DataSource.Close();
                    }
                    ScanningComplete(this, new ScanningCompleteEventArgs(exception));
                    break;

                case Message.CloseDS:
                    EndingScan();
                    DataSource.Close();
                    break;

                case Message.CloseDSOK:
                    EndingScan();
                    DataSource.Close();
                    break;

                case Message.DeviceEvent:
                    break;
            }

Fix:
            switch (_eventMessage.Message)
            {
                case Message.XFerReady:
                    Exception exception = null;
                    try
                    {
                        TransferPictures();
                    }
                    catch (Exception e)
                    {
                        exception = e;
                    }
                    finally
                    {
                        EndingScan();
                        DataSource.Close();
                    }
                    ScanningComplete(this, new ScanningCompleteEventArgs(exception));
                    break;

                case Message.CloseDS:
                    EndingScan();
                    DataSource.Close();
                    break;
                case Message.CloseDSReq:
                    EndingScan();
                    DataSource.Close();
                    break;

                case Message.CloseDSOK:
                    EndingScan();
                    DataSource.Close();
                    break;

                case Message.DeviceEvent:
                    break;
            }

Original comment by michel.w...@googlemail.com on 11 Mar 2011 at 2:14

GoogleCodeExporter commented 8 years ago
This looks like it is fixed in the latest checked-in code:

            switch (_eventMessage.Message)
            {
                case Message.XFerReady:
                    Exception exception = null;
                    try
                    {
                        TransferPictures();
                    }
                    catch (Exception e)
                    {
                        exception = e;
                    }
                    CloseDsAndCompleteScanning(exception);
                    break;

                case Message.CloseDS:
                case Message.CloseDSOK:
                case Message.CloseDSReq:
                    CloseDsAndCompleteScanning(null);
                    break;

                case Message.DeviceEvent:
                    break;

                default:
                    break;
            }

Can anyone confirm that?

Original comment by luke.qui...@gmail.com on 11 Mar 2011 at 11:30

GoogleCodeExporter commented 8 years ago
No,

it does not work for me. The problem is that no messages were received until 
the mouse is not over my own window and in the 'scanner' window. After a click 
to close, if i move the mouse over my app window, the message is received. 

Original comment by Mungo...@gmail.com on 28 Jun 2011 at 12:36