mirror of
https://github.com/soukoku/ntwain.git
synced 2026-02-25 13:04:07 +08:00
Fixed invalidcast exception on setting twframe to capability.
This commit is contained in:
@@ -146,10 +146,10 @@ namespace NTwain.Data
|
|||||||
break;
|
break;
|
||||||
case ItemType.Frame:
|
case ItemType.Frame:
|
||||||
TWFrame frame = (TWFrame)value;
|
TWFrame frame = (TWFrame)value;
|
||||||
WriteValue(baseAddr, ref offset, ItemType.Fix32, frame.Left);
|
WriteValue(baseAddr, ref offset, ItemType.Fix32, (TWFix32)frame.Left);
|
||||||
WriteValue(baseAddr, ref offset, ItemType.Fix32, frame.Top);
|
WriteValue(baseAddr, ref offset, ItemType.Fix32, (TWFix32)frame.Top);
|
||||||
WriteValue(baseAddr, ref offset, ItemType.Fix32, frame.Right);
|
WriteValue(baseAddr, ref offset, ItemType.Fix32, (TWFix32)frame.Right);
|
||||||
WriteValue(baseAddr, ref offset, ItemType.Fix32, frame.Bottom);
|
WriteValue(baseAddr, ref offset, ItemType.Fix32, (TWFix32)frame.Bottom);
|
||||||
return; // no need to update offset for this
|
return; // no need to update offset for this
|
||||||
//case ItemType.String1024:
|
//case ItemType.String1024:
|
||||||
// WriteString(baseAddr, offset, value as string, 1024);
|
// WriteString(baseAddr, offset, value as string, 1024);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace NTwain
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The build release version number.
|
/// The build release version number.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string Build = "3.3.0"; // change this for each nuget release
|
public const string Build = "3.3.1"; // change this for each nuget release
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using System.Collections;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
@@ -91,6 +92,10 @@ namespace Tester.WPF
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
if (ex is TargetInvocationException)
|
||||||
|
{
|
||||||
|
ex = ex.InnerException;
|
||||||
|
}
|
||||||
ModernMessageBox.Show(this, ex.Message, "Cannot Set", MessageBoxButton.OK, MessageBoxImage.Error);
|
ModernMessageBox.Show(this, ex.Message, "Cannot Set", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ namespace Tester.WPF
|
|||||||
{
|
{
|
||||||
_wrapper = wrapProperty.GetGetMethod().Invoke(ds, null);
|
_wrapper = wrapProperty.GetGetMethod().Invoke(ds, null);
|
||||||
var wrapperType = _wrapper.GetType();
|
var wrapperType = _wrapper.GetType();
|
||||||
_getMethod = wrapperType.GetMethod("Get");
|
_getMethod = wrapperType.GetMethod("GetValues");
|
||||||
_getCurrentMethod = wrapperType.GetMethod("GetCurrent");
|
_getCurrentMethod = wrapperType.GetMethod("GetCurrent");
|
||||||
_setMethod = wrapperType.GetMethods().FirstOrDefault(m => m.Name == "Set");
|
_setMethod = wrapperType.GetMethods().FirstOrDefault(m => m.Name == "SetValue");
|
||||||
}
|
}
|
||||||
|
|
||||||
var supportTest = ds.CapQuerySupport(cap);
|
var supportTest = ds.CapQuerySupport(cap);
|
||||||
|
|||||||
Reference in New Issue
Block a user