Home › Forums › TWAIN Classic › Acquire while another TWAIN session ist still active
- This topic has 4 replies, 2 voices, and was last updated 17 years, 10 months ago by Kaij.
- AuthorPosts
Usually applications gray out the Acquire menu entry while a TWAIN session is still active. E.g. TWACKER behaves like this. Some other applications like IrfanView 3.95 do not gray out acquire and select source while a TWAIN session is sctive. When my DS is active and another acquire will be started Irfan hangs after a second Acuire and I need to kill it in the Task Manager. What can I do on DS side to prevent this problem?
Best regards,
Kai
just to come ahead of all this spam as question is still open
> When my DS is active and another acquire will be started Irfan
> hangs after a second Acuire and I need to kill it in the Task Manager.
> What can I do on DS side to prevent this problem?Use a global mutex to know when your DS is already open. If you can’t acquire the mutex on DG_CONTROL/DAT_IDENTITY/MSG_OPENDS put up a message such as “Error: TWAIN Data Source is in-use.” and return TWRC_FAILURE/TWCC_OPERATIONERROR. This will prevent the user from reopening your DS but it will not prevent them from opening another vendor’s DS while yours is open.
It could be a bug in Irfan. You may want to contact the developer.
Thank you for that idea. I will implement it and share the result with you.
Best regards,
Kaij
I thought that is a good idea and implemented the mutex check when receiving
DG_CONTROL/DAT_IDENTITY/MSG_OPENDS
But I had to learn that I am not receiving DG_CONTROL/DAT_IDENTITY/MSG_OPENDS for the second time. It seems that IrfanView hangs before I receive this.
Is there any other idea?
Kaij
- AuthorPosts