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

Unable to process data source messages?

Forums › TWAIN Classic › Unable to process data source messages?

  • This topic has 1 reply, 1 voice, and was last updated 10 years, 11 months ago by twainuser123.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 10, 2010 at 4:25 am #22606 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    Hi,

    I am still new to TWAIN and am now at the stage of implementing the event loop (on windows Vista on MSVC++), but am running into problems.
    Basically, TW_EVENT.TWMessage is always set to 0 using the below code:

    TW_EVENT curEvent;
    curEvent.pEvent = (TW_MEMREF)curMesage;

    //Ask the data source to fill 'curEvent'
    DSM_Entry(&appIdentity, &curDataSource, DG_CONTROL, DAT_EVENT, MSG_PROCESSEVENT, (TW_MEMREF)&curEvent);
    if (this->lastDSMReturnCode != TWRC_DSEVENT)
    { //This event does not belong to the data source (or there was a failure)
    return true; //The application should process this message
    }

    if (curEvent.TWMessage)
    { //This line is never reached!!
    return true;
    }

    If it helps, I am new to Windows and am using

    HWND appWindow = FindWindow(NULL, NULL);

    to get the HWND for the application. The UI for the data source loads fine, but maybe this HWND is the problem?

    I am targeting a command-line application so do not want to show a UI eventually.

    Thanks in advance!

    May 16, 2010 at 7:35 pm #25260 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    Nevermind…

    I found out that I needed an event loop.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Unable to process data source messages?
Your information:




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

  • PDF/R For who and where?
  • Making searchable PDF with PDF/R
  • Backward compatibility with PDF/A and traditional PDF
  • could not open the twain source. Make sure there is a valid source for your sca
  • Changing TWAIN driver defaults
  • 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

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.