Home › Forums › TWAIN Classic › TWAIN 2.x driver and 1.x Application
- This topic has 5 replies, 3 voices, and was last updated 10 years, 8 months ago by MarkM.
- AuthorPosts
Hello,
I hope this is not a duplicate/triplicate question….. didn’t manage to find any answer here.
I’m working on a driver that should be TWAIN 2.x compliant.
Which is the correct way for a 2.x compliant driver to interact with a 1.x application? First of all, is it allowed? I suppose yes, but…
If I understood well, a 2.x driver HAS to be able to interact with both DSM (twaindsm.dll and twain_32.dll). Is there a sample application to illustrate this?
The major differences I noticed up to now were the DSM file and the memory management functions. And, of course, the new capabilities. Did I miss something? Is there something I should be specially careful about?Thank you
DaianaHi Daiana,
>If I understood well, a 2.x driver HAS to be able to interact with both DSM (twaindsm.dll and twain_32.dll). Is there a sample application to illustrate this?
You can download and play with the TWAIN sample data source and app to see how it works.
Catherine Sea
http://www.dynamsoft.com – web based TWAIN scanning SDKthank you!
Just a couple of notes about 2.x vs 1.x
– There are no special changes in the communication between the application and the driver, there are changes in the way the application and the driver interact with the Data Source Manager, but only for TWAINDSM not for TWAIN_32; TWAIN _32 is legacy code that hasn’t changed in any meaningful way since about 2002.
– Declaring a TW_IDENTITY.ProtocolMajor of 2 is not enough to get an application recognized as a TWAIN 2.x complaint, this is because the TWAIN Working Group recognized that application and driver writers sometimes drop in a new twain.h file without fully investigating the consequences.
– If an application wants to declare itself as TWAIN 2.x ready it needs to set the TW_IDENTITY.ProtocolMajor to 2 and it must add the DF_APP2 flag to its TW_IDENTITY.SupportedGroups.
– When this is done the application is expected to issue DG_CONTROL / DAT_ENTRYPOINT / MSG_GET to the DSM while in state 3, this returns pointers to functions that the app can use for managing memory.
In all instances a 2.x app is expected to work with any TWAIN driver, no matter what version of TWAIN its using…
but is a 1.x application also supposed to work with any driver?
Yes it is…TWAIN is designed to allow any version application to work with any version driver. That means that a 1.5 app can run a 2.2 driver, and 2.2 app can run a 1.5 driver…
- AuthorPosts