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

Getting Twain command null on Vista Home Basic…

Forums › TWAIN Classic › Getting Twain command null on Vista Home Basic…

  • This topic has 0 replies, 1 voice, and was last updated 11 years, 6 months ago by madangopals.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • July 6, 2009 at 4:27 pm #22508 Reply
    madangopals
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    Hi Guys,

    I am a software engg. working with Chetu Inc.
    I have developed one scanner application using the twain_32.dll api and developed it in the c#, .NET framework version 3.5. My application works fine to scan document from scanner flatbed or feeder when i used windows xp operating system with scanner/printer hp 3050 series or with dell scanner/printer 2335dn MFP.

    I am facing one issue when i deployed my windows desktop scanner application on the vista home basic and try to scan document from the dell 2335dn MFP scanner.

    Its not working for the feeder option of scanner and scan only one document from feeder if still there are multiple documents available on the feeder.

    Follwing is the code section which i am trying to use to transfer scan image from scanner device to memory:

    ArrayList pics = new ArrayList();
    if (srcds.Id == IntPtr.Zero)
    return pics;

    TwRC rc;
    IntPtr hbitmap = IntPtr.Zero;
    TwPendingXfers pxfr = new TwPendingXfers();

    do
    {
    pxfr.Count = 0;
    hbitmap = IntPtr.Zero;

    TwImageInfo iinf = new TwImageInfo();

    rc = DSiinf(appid, srcds, TwDG.Image, TwDAT.ImageInfo, TwMSG.Get, iinf);
    // rc = DSiinf(appid, srcds, TwDG.Image, TwDAT.ImageLayout, TwMSG.Set, iinf);
    if (rc != TwRC.Success)
    {
    CloseSrc();
    return pics;
    }
    //This external method call is used to transfer the data from
    //the data source to bitmap.
    //rc = DSixfer( appid, srcds, TwDG.Image, TwDAT.ImageNativeXfer,
    //TwMSG.Get, ref hbitmap );
    rc = DSixfer(appid, srcds, TwDG.Image, TwDAT.ImageNativeXfer,
    TwMSG.Get, ref hbitmap);

    if (rc != TwRC.XferDone)
    {
    CloseSrc();
    return pics;
    }
    //Preparing for the multiple image transer. it returns the DAT_PendingXfers.count
    //and transitions the session to state 6 (Transfer Ready)
    // if the count of pending transfer is nonzero, or to state 5(Source Enabled) if
    //the count is zero.
    rc = DSpxfer(appid, srcds, TwDG.Control, TwDAT.PendingXfers,
    TwMSG.EndXfer, pxfr);
    if (rc != TwRC.Success)
    {
    CloseSrc();
    return pics;
    }

    pics.Add(hbitmap);
    }
    while (pxfr.Count != 0);
    //Check if the there are any pending image data need to transfered.

    //This external call of the method is used to reset the pending
    //transfer of data.
    rc = DSpxfer(appid, srcds, TwDG.Control, TwDAT.PendingXfers,
    TwMSG.Reset, pxfr);
    return pics;

    see the following definitions for reference.

    Basically i am not getting the value for pxfr variable and it is not updated for the next image data transfer.

    [DllImport(“twain_32.dll”, EntryPoint=”#1″)]
    private static extern TwRC DSpxfer( [In, Out] TwIdentity origin,
    [In] TwIdentity dest, TwDG dg, TwDAT dat,
    TwMSG msg, [In, Out] TwPendingXfers pxfr );

    [StructLayout(LayoutKind.Sequential, Pack=2)]
    internal class TwPendingXfers
    { // TW_PENDINGXFERS
    public short Count;
    public int EOJ;
    }

    Please help me if anyone have any idea.

    Thanks
    Madan Gopal Soni

  • Author
    Posts
Viewing 1 post (of 1 total)
Reply To: Getting Twain command null on Vista Home Basic…
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

  • Hello world
  • Girls of Desire: All babes in one place, crazy, art
  • 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
  • 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.