mirror of
https://github.com/soukoku/ntwain.git
synced 2025-10-08 00:14:38 +08:00
Properly catch and throw exceptions on message loop .invoke() calls (#79)
This commit is contained in:
@@ -22,7 +22,14 @@ namespace Sample
|
||||
// just an amusing example to do twain in console without UI
|
||||
ThreadPool.QueueUserWorkItem(o =>
|
||||
{
|
||||
DoTwainWork();
|
||||
try
|
||||
{
|
||||
DoTwainWork();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("ERROR: " + ex.ToString());
|
||||
}
|
||||
});
|
||||
Console.WriteLine("Test started, press Enter to exit.");
|
||||
Console.ReadLine();
|
||||
|
Reference in New Issue
Block a user