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

Problem using DG_CONTROL / DAT_CUSTOMDSDATA / MSG_SET

Forums › TWAIN Classic › Problem using DG_CONTROL / DAT_CUSTOMDSDATA / MSG_SET

  • This topic has 1 reply, 2 voices, and was last updated 5 years, 5 months ago by MarkM.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 6, 2015 at 9:11 pm #23023 Reply
    Rikr2
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    Hello,
    I’m developing an application that uses TWAIN (APP and DSM TWAIN 2.0 compliant) for scanning. This application allows users to set/get the current configuration of each device using DAT_CUSTOMDSDATA. When I get the CustomData and then set the same exported file, no error occurs and yet the values defined in the CustomData remain unchanged. I test the exported CustomData file in EZTWAIN tool and it works perfectly, so it must be an error in the set method. I’m using for testing the escanner Fujitsu fi-60f (DS TWAIN 1.0 compliant). Below I show the code i use for set.

    // pItem contain the customdata loaded directly from disk, pLength contain the length of pItem.
    bool setCurrentCAP_CUSTOMDSDATA( uint8_t * pItem , uint32_t pLength )
    {
    bool result = false;
    // Check if twain is in state 4.
    if( TWAIN_state == TWAIN_STATE_4 )
    {
    // check that is supported CAP_CUSTOMDSDATA and CAP_ENABLEDSUIONL.
    TW_CAPABILITY customDataCAP = queryCAP_CUSTOMDSDATA();
    TW_CAPABILITY enableDsUiOnlyCAP = queryCAP_ENABLEDSUIONLY();
    if( customDataCAP . hContainer && enableDsUiOnlyCAP . hContainer )
    {
    // Check if CAP_CUSTOMDSDATA and CAP_ENABLEDSUIONL values are true.
    pTW_ONEVALUE customDataValuePtr = pTW_ONEVALUE( GlobalLock( customDataCAP . hContainer ) );
    pTW_ONEVALUE enableDsUiOnlyValuePtr = pTW_ONEVALUE( GlobalLock( enableDsUiOnlyCAP . hContainer ) );
    if( TW_BOOL( customDataValuePtr -> Item ) != FALSE && TW_BOOL( enableDsUiOnlyValuePtr -> Item ) != FALSE )
    {
    if( pItem && pLength > 0 )
    {
    pTW_CUSTOMDSDATA customData = getCurrentCAP_CUSTOMDSDATA();
    if(customData && customData->hData && customData->InfoLength > 0)
    {
    customData->hData = GlobalAlloc( pLength );
    memcpy( customData->hData , pItem,pLength );
    customData->InfoLength = pLength;
    // This function call ( *_DSM_EntryPtr )( AppIdPtr , SourceIdPtr , DG_CONTROL , DAT_CUSTOMDSDATA , MSG_SET, customData );
    TW_UINT16 setCapabilityResult = getDSEntry( DG_CONTROL , DAT_CUSTOMDSDATA , MSG_SET , customData );
    if( setCapabilityResult == TWRC_SUCCESS )
    {
    result = true;
    }
    }
    }
    }
    GlobalUnlock( customDataCAP . hContainer );
    GlobalUnlock( enableDsUiOnlyCAP . hContainer );
    }
    }
    return result;
    }

    Thanks

    August 4, 2015 at 2:45 pm #26300 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    If you try the same thing with a Kodak Document Imaging scanner (running in simulation mode is fine for the test, an i5200 would serve well), you can see if the code works, and if not, I can probably offer some advice. Otherwise your best bet is to contact the vendor directly and see what help they can offer…

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Problem using DG_CONTROL / DAT_CUSTOMDSDATA / MSG_SET
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

  • Big Ass Photos – Free Huge Butt Porn, Big Booty Pics
  • 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.
  • 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.