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

Re: Do you solve the duplex acquisition problem?

Forums › TWAIN Classic › Please tell me how Duplex scanning with C# program? › Re: Do you solve the duplex acquisition problem?

October 15, 2008 at 1:46 pm #23285
SerenaFab
Participant
  • Topics - 0
  • Replies - 2
  • Total Posts - 2

Hi,
I tryed to set the duplex capability, but the return message is always failure (I tried with 2 different scanner),
anyway the setting has no effect on the acquisition.
I checked the duplex capability, and the aswer is success.
This is my code:


TwRC rc;
rc = DSMident(appid, IntPtr.Zero, TwDG.Control, TwDAT.Identity, TwMSG.OpenDS, srcds);
if (rc != TwRC.Success) return;
//I set the multi-page capability
TwCapability cap = new TwCapability(TwCap.XferCount, -1);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap);
if (rc != TwRC.Success) {
CloseSrc();
return; }
//I'm trying to disable the duplex
TwCapability capDuplex = new TwCapability(TwCap.CAP_DUPLEXENABLED,0);
//In this point I receive Failure
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, capDuplex

Is this code correct?
Do you have any suggestion?
Thank you

@gabe wrote:

Right. You may want to check the return and condition codes further on your calls. You also may want to consider checking querysupport before setting the cap.

But more directly, it looks like you abort the scan if Any of the caps you are setting return anything but success. When you step thru this with your device, where does it exit?
Could be that for your device it returns when setting xfercount (not likely but possible), duplexEnabled (more likely – specially since you don’t seem to be checking whether or how duplex is supported first, I suspect this call the most), or even feederEnabled.

I’m assuming that you are certain that the device supports duplex?
So step thru it, where does it return when intDuplex==1?, and what was the specific rc and cc?
And what are you using for a source?

I’m going to guess this is based on netmasters code from codeproject, did you adjust the constructor for a new cap or are you using his code as-is?

gabe

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