Integrated message thread inside TwainAppSession as a different OpenDSM method.

This commit is contained in:
Eugene Wang
2023-04-15 06:33:12 -04:00
parent 0e5aef00e5
commit 1364150697
8 changed files with 142 additions and 34 deletions

View File

@@ -11,14 +11,13 @@ namespace WinConsole32
var libVer = FileVersionInfo.GetVersionInfo(typeof(TwainAppSession).Assembly.Location).ProductVersion;
Console.WriteLine($"Console sample {(TWPlatform.Is32bit ? " 32bit" : " 64bit")} on NTwain {libVer}");
MessagePumpThread pump = new MessagePumpThread();
TwainAppSession session = new TwainAppSession(Environment.ProcessPath!);
session.StateChanged += Session_StateChanged;
session.SourceDisabled += Session_SourceDisabled1;
session.Transferred += Session_Transferred;
var sts = await pump.AttachAsync(session);
var sts = await session.OpenDSMAsync();
if (sts.IsSuccess)
{