Home › Forums › TWAIN Classic › Twain Callback — Developing with MFC › Reply To: Twain Callback — Developing with MFC
Thank you for bringing this to our attention.
The intention of RefCon is missing from the spec and will be fixed. RefCon will be returned in pData in the next release of the DSM. Because it was not defined as TW_MEMREF it should not be used to store a pointer because it will fail on 64bit OS.
How is Apple getting around this on 64bit if they are passing pointers?
Maybe passing in a TlsAlloc value is the way to go.
Yes the Sample App uses globals. 🙂
Modifying the application name might unwanted have side effects. Some DS choose to store the last used settings for each Application name that opens it. If the name keeps changing you might not get the settings you expected.
Using callbacks does not eliminate the need of the windows event message pump.
On the Mac starting with OSX if was required for the DS to register their own functions with the OS for handling windows messages. That meant they no longer needed the DAT_EVENT for pumping messages and added the Callback to handle the DS notifying the App.
Unlike the Mac on Windows TWAIN 1.x DS will continue to work with TWAIN 2.x Applications. It does not matter if the TWAIN application implements notification via callbacks or DAT_EVENT.
The important thing to remember in the callback routine is to get the message and data passed. Return immediately. Then act on the message received.
Regards,
Jim Watters
**************************************************
JFL Peripheral Solutions Inc.
http://www.jflinc.com/
Your Expert Source of Custom Software and Services
for TWAIN Applications, Data Sources,
Peripheral Drivers and Support Software.
**************************************************