- This topic has 1 reply, 2 voices, and was last updated 8 years, 1 month ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
Forums › TWAIN Classic › SelectSource / ShowUserInterface not opening
When I debugging this code it works fine and opens the select source dialog box and the user interface for the scanner but when I run the application as a service these items do not open. I have tried running the service as local system account with allow interact with desktop and also as a user with admin privleges and it still stalls when it hits these lines of code. Any suggestions/thoughts?
Here is a simplified version of what I am trying to do. If I remove the selectSource and set showuserinterface to false it will scan the document and if I leave those things in the log will only show “1” showing it stalling when it hits the selectsource line.
log.Trace(“1”);
twainDevice.SelectSource();
log.Trace(“2”);
twainDevice.ShowUserInterface = true;
log.Trace(“3”);
twainDevice.StartSession();
Normally a service under Windows does not have Window and GDI services, which are relied on (heavily) by TWAIN and by TWAIN drivers. Some possible workarounds:
http://stackoverflow.com/questions/267838/how-can-a-windows-service-execute-a-gui-application