Fixed #30 version check logic.

This commit is contained in:
soukoku
2014-12-29 18:07:34 -05:00
parent cad36ecf0b
commit 0ad1a72bba
2 changed files with 4 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ namespace NTwain
/// <summary>
/// The build release version number.
/// </summary>
public const string Build = "3.2.3"; // change this for each nuget release
public const string Build = "3.2.4"; // change this for each nuget release
}

View File

@@ -122,8 +122,8 @@ namespace NTwain
{
Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "Thread {0}: EnableSource with {1}.", Thread.CurrentThread.ManagedThreadId, mode));
// app v2.2 or higher uses callback2
if (_appId.ProtocolMajor >= 2 && _appId.ProtocolMinor >= 2)
// per the spec (8-10) app v2.2 or higher uses callback2
if (_appId.ProtocolMajor > 2 || (_appId.ProtocolMajor >= 2 && _appId.ProtocolMinor >= 2))
{
var cb = new TWCallback2(HandleCallback);
var rc2 = ((ITwainSessionInternal)this).DGControl.Callback2.RegisterCallback(cb);
@@ -136,6 +136,7 @@ namespace NTwain
}
else
{
// all else try old callback
var cb = new TWCallback(HandleCallback);
var rc2 = ((ITwainSessionInternal)this).DGControl.Callback.RegisterCallback(cb);