TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Reply To: Twain Callback — Developing with MFC

Forums › TWAIN Classic › Twain Callback — Developing with MFC › Reply To: Twain Callback — Developing with MFC

May 5, 2009 at 9:20 pm #24899
jimwatters
Participant
  • Topics - 2
  • Replies - 72
  • Total Posts - 74

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.
**************************************************

Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in