Home › Forums › TWAIN Classic › TWAIN/WIA
- This topic has 3 replies, 4 voices, and was last updated 18 years, 10 months ago by JonHarju.
- AuthorPosts
I’m working with some scanners (Brother scanners) that run under Windows XP with combined TWAIN/WIA drivers. I’ve gotten some bizarre errors, and I’m wondering if anyone has had some experience with this kind of driver and how to handle it.
Thank you,
NARP
I am currently writing an application for a computer microscope using TWAIN and I am testing the application using the microscope, the TWAIN sample source and my TWAIN/WIA webcam. None of them are fully functional at the moment. Oddly enough, the webcam seems to be a bit more functional than the sample source (in state 5, several buttons work, while the sample sources buttons don’t work at all). Is this similar to your experiences?
(I know something is wrong with the TWAIN part of my event loop. My guess is that the working buttons don’t use TWAIN commands, but work with WIA instead… but I am absolutely no expert in these matters.)
Be careful with the sample source. There are some problems. Most notably, if you try to set the X_Resolution property, you always get a BadValue error. It’s useful in some respects, but there are some small bugs that keep it from being an ideal “proving ground” for TWAIN development.
I got a post on the twain.org website that mentioned that the TWAIN/WIA drivers do give some bad values, but the results aren’t predictable from one device to the next. I think it’s safe to say that these drivers are not TWAIN-compliant.
I don’t yet know much about WIA to tell you about the alternative. Probably, the device responses will be consistent for the particular machine and device you are using. If you make your own map of values to actions, you be able to get something accomplished.
Good luck,
NARP
@student wrote:
I am currently writing an application for a computer microscope using TWAIN and I am testing the application using the microscope, the TWAIN sample source and my TWAIN/WIA webcam. None of them are fully functional at the moment. Oddly enough, the webcam seems to be a bit more functional than the sample source (in state 5, several buttons work, while the sample sources buttons don’t work at all). Is this similar to your experiences?
(I know something is wrong with the TWAIN part of my event loop. My guess is that the working buttons don’t use TWAIN commands, but work with WIA instead… but I am absolutely no expert in these matters.)
Hello,
It’s not clear what you mean by buttons not working, this could be a variety of things. A few of them are event loop related as you have surmised…
Remember to forward all messages using DAT_EVENT/MSG_PROCESSEVENT and inspect the return code. If the return code is TWRC_DSEVENT then you have to inspect the TWMessage component of the structure – if this is MSG_XFERREADY or MSG_CLOSEDSREQ then you are expected to do something. It is possible that TWMessage will not be either of these in which case you are just supposed to ignore it and continue on to the next message in the queue.
If the return code is TWRC_NOTDSEVENT then you are expected to allow windows to process the message normally with TranslateMessage, DispatchMessage calls.
Remember – if you recieve TWRC_DSEVENT – you are not to dispatch the message to TranslateMessage, DispatchMessage at all – this will cause all kids of strange GUI behavior if you do.
Best Regards,
Jon Harju- AuthorPosts