Home › Forums › TWAIN Classic › Q "DG_CONTROL/DAT_ENTRYPOINT/MSG_SET(MSG_GET)"
- This topic has 3 replies, 3 voices, and was last updated 9 years, 11 months ago by MarkM.
- AuthorPosts
I am testing the TWAIN driver of a scanner.
Is the following certainly required CAP?“DG_CONTROL/DAT_ENTRYPOINT/MSG_SET(MSG_GET)”
It seems that the above-mentioned command becomes effective when supporting DSM2 to the source code which I obtained.
DF_DSM2 does not understand what it is.
Is it the function added after the version 2.0?Howdy…
First off, here are the rules…
If the application reports itself as TWAIN version 2.0 or higher *and* it includes the DF_APP2 flag in its TW_IDENTITY.SupportedGroups field, then the application fully supports TWAIN 2.0.
If the TW_IDENTITY.SupportedGroups field from the application includes the DF_DSM2 flag, then the Data Source Manager (DSM) fully supports TWAIN 2.0.
If the TWAIN driver reports itself as TWAIN version 2.0 or higher *and* it includes the DF_DS2 flag in its TW_IDENTITY.SupportedGroups field, then the driver fully supports TWAIN 2.0.
Any combination of the three situations described above is allowed, but the following two are the only ones you need to worry about. Refer to the TWAIN Specification to see what DAT_ENTRYPOINT is doing.
If the DSM and the application both support TWAIN 2.0, then the application must call DG_CONTROL / DAT_ENTRYPOINT / MSG_GET down into the DSM before calling DG_CONTROL / DAT_IDENTITY / MSG_OPENDS.
If the DSM and the driver both support TWAIN 2.0, then the DSM will automatically call DG_CONTROL / DAT_ENTRYPOINT / MSG_SET down into the driver before it passes along a call to DG_CONTROL / DAT_IDENTITY / MSG_OPENDS from the application.
If I understand correctly, memory allocated by a TWAIN 1 source (using ::GlobalAlloc) and passed to a TWAIN 2 app (which will call DSM_MemFree to free it) will be handled properly by a TWAIN 2 manager (i.e., freed using ::GlobalFree)?
Currently, on Windows, the Global heap calls are still used throughout the system. We’ve not done anything fancy yet.
The intention for TWAIN 2.x was to provide a path to using alternatives. Therefore, at some future date, if the DSM recognizes that both the application and the driver fully support TWAIN 2.x, it will have the option to use a different heap API, since both will be calling memory functions from inside of the DSM.
If either the application or the driver isn’t TWAIN 2.x compliant, the DSM will always revert to the Global heap calls.
- AuthorPosts