From 844f84e2593899de5cdbebf7aaf610e659f36432 Mon Sep 17 00:00:00 2001 From: soukoku Date: Sat, 3 Jan 2015 11:29:38 -0500 Subject: [PATCH] Some comments. --- NTwain/Internals/TransferLogic.cs | 4 ++-- NTwain/TwainSessionInternal.cs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NTwain/Internals/TransferLogic.cs b/NTwain/Internals/TransferLogic.cs index 54a5069..3595a99 100644 --- a/NTwain/Internals/TransferLogic.cs +++ b/NTwain/Internals/TransferLogic.cs @@ -20,8 +20,8 @@ namespace NTwain.Internals public static void DoTransferRoutine(ITwainSessionInternal session) { var pending = new TWPendingXfers(); - var rc = ReturnCode.Success; - + //var rc = ReturnCode.Success; + var rc = session.DGControl.PendingXfers.Get(pending); do { #region build and raise xfer ready diff --git a/NTwain/TwainSessionInternal.cs b/NTwain/TwainSessionInternal.cs index 91ba38e..36fcd59 100644 --- a/NTwain/TwainSessionInternal.cs +++ b/NTwain/TwainSessionInternal.cs @@ -210,7 +210,7 @@ namespace NTwain #region IWinMessageFilter Members /// - /// Checks and handle the message if it's a TWAIN message. + /// Checks and handles the message if it's a TWAIN message. /// /// The window handle. /// The message. @@ -265,6 +265,8 @@ namespace NTwain // spec says we must handle this on the thread that enabled the DS. // by using the internal dispatcher this will be the case. + // In any event the trick to get this thing working is to return from the callback first + // before trying to process the msg or there will be unpredictable errors. _msgLoopHook.BeginInvoke(() => { HandleSourceMsg(msg);