Questions to TwainEnableDuplex
Questions to TwainEnableDuplex
Hi,
i was wondering.... TwainEnableDuplex() stopped working in my test project. (it was returning true but the scanner didnt run in duplex mode) I moved the position of the command after some others like TwainSetIndicators, TwainsetAutoClose, TwianSetResolution and so on and it was working again.
So the first question ... what can be the reason for this?
second question: I use exactely the same code in another project. Here the method returns false:
GdLib.TwainGetLastResultCode() TWRC_FAILURE
GdLib.TwainGetLastConditionCode() TWCC_BADCAP
Any ideas?
Regards
dix
i was wondering.... TwainEnableDuplex() stopped working in my test project. (it was returning true but the scanner didnt run in duplex mode) I moved the position of the command after some others like TwainSetIndicators, TwainsetAutoClose, TwianSetResolution and so on and it was working again.
So the first question ... what can be the reason for this?
second question: I use exactely the same code in another project. Here the method returns false:
GdLib.TwainGetLastResultCode() TWRC_FAILURE
GdLib.TwainGetLastConditionCode() TWCC_BADCAP
Any ideas?
Regards
dix
Re: Questions to TwainEnableDuplex
Hi Dix,
Maybe the scan was not in state 4 ?
If you want more investigation from use, please write us a code snippet to reproduce the behavior.
With best regards,
Loïc
Maybe the scan was not in state 4 ?
If you want more investigation from use, please write us a code snippet to reproduce the behavior.
With best regards,
Loïc
Re: Questions to TwainEnableDuplex
TwainGetState() returns TWAIN_SOURCE_OPEN
my twain init looks like this:
intresting is that the code works in a test project and in my app it doesnt.
Also (GdLib.TwainIsAutoScanAvailable()) returns true in my test project and false in my app.
greets
dix
my twain init looks like this:
Code: Select all
if (!OpenTwainDevice(Config.DeviceName))
return false;
if (GdLib.TwainIsAutoFeedAvailable())
GdLib.TwainSetAutoFeed(true);
if (GdLib.TwainIsAutoScanAvailable())
GdLib.TwainSetAutoScan(true);
GdLib.TwainSetAutomaticBorderDetection(true);
GdLib.TwainSetAutomaticDiscardBlankPages(true);
GdLib.TwainSetAutoSize(true);
GdLib.TwainSetAutoBrightness(true);
GdLib.TwainSetAutomaticRotation(true);
GdLib.TwainSetAutomaticDeskew(true);
GdLib.TwainSelectFeeder(true);
GdLib.TwainSetHideUI(Config.HideTwainGui);
if (Config.HideTwainGui) // true in this example
{
GdLib.TwainSetBitDepthReduction(TwainBitDepthReduction.TWBR_DIFFUSION);
//less than 300 will not detect barcodes
GdLib.TwainSetResolution((int)Config.Resolution);
GdLib.TwainSetPixelType((TwainPixelType)Config.ImageType);
GdLib.TwainSetModalUI(false);
bool bSetBits;
switch (Config.ImageType)
{
case ScanImageType.TEXT:
bSetBits = GdLib.TwainSetBitDepth(1);
break;
case ScanImageType.GRAY:
bSetBits=GdLib.TwainSetBitDepth(8);
break;
default:
bSetBits=GdLib.TwainSetBitDepth(24);
break;
}
if (!bSetBits)
System.Diagnostics.Trace.WriteLine("Failed to set bitdepth!");
}
GdLib.TwainSetIndicators(Config.ShowIndicators);
GdLib.TwainSetAutoSourceClose(false);
if (!GdLib.TwainEnableDuplex(Config.EnableDuplex))
[b]System.Diagnostics.Trace.WriteLine("Setting Duplex Property failed! ");[/b]
Also (GdLib.TwainIsAutoScanAvailable()) returns true in my test project and false in my app.
greets
dix
Re: Questions to TwainEnableDuplex
damn it. i got the reason. the working project uses not use the WIA driver. The other project uses for some reason that driver.
This is caused by GdLib.TwainGetSourceCount(IntPtr.Zero)
Its the same code. One project returns 2 sources, one 3. One the same machine?
How can that be? Its only returning the WIA drivers on my application...
regards
This is caused by GdLib.TwainGetSourceCount(IntPtr.Zero)
Its the same code. One project returns 2 sources, one 3. One the same machine?
How can that be? Its only returning the WIA drivers on my application...
regards
Re: Questions to TwainEnableDuplex
Hi,
I suppose that your TWAIN driver is not correctly installed.
With best regards,
Loïc
How can that be? Its only returning the WIA drivers on my application...
I suppose that your TWAIN driver is not correctly installed.
With best regards,
Loïc
Re: Questions to TwainEnableDuplex
it is. i have 2 testproject that use the same DLL that returns the TwainCount.
One App says 2 devices found. The other says 3 devices found.
Probably its one specific setting. I couldnt figure out which one.
One App says 2 devices found. The other says 3 devices found.
Probably its one specific setting. I couldnt figure out which one.
Who is online
Users browsing this forum: No registered users and 2 guests