soukoku / ntwain

A TWAIN lib for dotnet.
MIT License
119 stars 50 forks source link

Detect device error when using Enable function. #12

Closed baku-hatsu closed 4 years ago

baku-hatsu commented 4 years ago

Is it even possible to detect if: TwainSession.CurrentSource.Enable(SourceEnableMode.NoUI, false, Handle); showed error? For example when there are no pages, i would get error window saying things, however the Enable function would return success. No events happens on session itself apart state changes.

baku-hatsu commented 4 years ago

I found solution with help of this problem. To detect if there are no pages in ADF it is possible to use dataSource.Capabilities.CapFeederLoaded.GetCurrent() == BoolType.True and so throw your own custom message and do additional handling.