Click here to Skip to main content
15,909,440 members
Please Sign up or sign in to vote.
1.50/5 (4 votes)
See more:
I have removed the question.............................................

What I have tried:

Removed question....................................
Posted
Updated 26-Jul-16 14:05pm
v3
Comments
Patrice T 26-Jul-16 15:07pm    
and you will publish the error message ?
[no name] 26-Jul-16 15:14pm    
Yes, I apologize, I forgot to add that.

it is COMException was unhandled
'System.Runtime.InteropServices.COMEXception'

Exception from HRESULT: 0x80210003
Patrice T 26-Jul-16 15:26pm    
No problem.
Use Improve question to update your question.
So that everyone can pay attention to this information.
Dave Kreskowiak 26-Jul-16 15:41pm    
Have you tried looking up that exception message? It means "There are no documents in the document feeder."

I think you should be catching this exception and handling it appropriately.
[no name] 26-Jul-16 15:47pm    
Yes I did. I just don't understand why it is giving me that because it scans all the documents, and then it throws that. I just added in a try/catch to it, but it just throws the same exception. If I take the foreach loop out, the program works fine, but it only will scan one page and end.

1 solution

Why use a for each loop if you don't use Property in the loop ?
C#
foreach (Property item in scannerDevice.Items[1].Properties)

Quote:
I just don't understand why it is giving me that because it scans all the documents, and then it throws that.
You continuously scan all sheets of paper without checking if there is something to scan and you wonder why you get an exception when feeder is empty and nothing to scan ? Serious ?
Do you expect you code to stop scanning magically ?

Either you handle the exception or you test if there is something in the feeder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900