How to identify WIA scanner
Posted: Fri Apr 06, 2012 6:34 am
Hello,
When I call the method TwainSelectSource, all of the scanner driver's appear, including WIA drivers. If my user chooses a WIA driver, I want to be able to scan using the WIA methods. I am able to identify that the user chose a WIA driver because it usually has WIA in the source name or in the source family.
In order to scan using WIA methods I need to open the scanner using the scanner's SourceID. The problem is that there is no good way of getting the source id of the scanner that was chosen within the TWAINSelectSource dialog. I can loop through the available WIA scanners using the WIAGetSourceName method, but the WIA source Name's don't match the names that were previously given when calling the TWAINGetSourceName method, so there is no good way to match the scanner that they chose to the appropriate WIA SourceID.
I know that you are going to say not to use WIA scanning, but unfortunately they show up in the TWAINSelectSource dialog, so user's will naturally choose them. Plus, I need my user's to be able to use the WIA driver in the event that the TWAIN driver doesn't work, as is the case with my Xerox Documate 510 scanner, which will not open when scanning in a separate thread.
What would be the best way to correctly match a WIA scanner chosen from the TWAINSelectSource dialog to the appropriate WIASourceID?
Thanks,
Reagan
When I call the method TwainSelectSource, all of the scanner driver's appear, including WIA drivers. If my user chooses a WIA driver, I want to be able to scan using the WIA methods. I am able to identify that the user chose a WIA driver because it usually has WIA in the source name or in the source family.
In order to scan using WIA methods I need to open the scanner using the scanner's SourceID. The problem is that there is no good way of getting the source id of the scanner that was chosen within the TWAINSelectSource dialog. I can loop through the available WIA scanners using the WIAGetSourceName method, but the WIA source Name's don't match the names that were previously given when calling the TWAINGetSourceName method, so there is no good way to match the scanner that they chose to the appropriate WIA SourceID.
I know that you are going to say not to use WIA scanning, but unfortunately they show up in the TWAINSelectSource dialog, so user's will naturally choose them. Plus, I need my user's to be able to use the WIA driver in the event that the TWAIN driver doesn't work, as is the case with my Xerox Documate 510 scanner, which will not open when scanning in a separate thread.
What would be the best way to correctly match a WIA scanner chosen from the TWAINSelectSource dialog to the appropriate WIASourceID?
Thanks,
Reagan