This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, May 17, 2006 8:29:22 AM(UTC)
Groups: Registered
Posts: 8
I am currently working on setting the default settings to a scanner. After getting the default value, when I try and set the resolution to the default value that I just retreived results in this -568 error.
Is it possible that if the default value has already been set to the scanner that I cannot set the same value again?
#2
Posted
:
Monday, May 22, 2006 12:56:35 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Error -568 means that you have passed an invalid capability value.
However, this depends on the value that you have passed to change the image resolution. What is the exact value that you used to change the resolution? Can you please provide me with a code snippet that shows this issue?
Can you please recheck the same issue using the following instructions?
- Call the L_TwainGetResolution function to get the current value of the image resolution.
- Now, use the value that you get from the L_TwainGetResolution function and pass it to the L_TwainSetResolution function. What is the exact result that you get?
- Now, try to set the resolution to the value that shows error number -568. What is the exact result that you get?
Please provide me with the above information and let me know how it goes.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Monday, May 22, 2006 8:42:43 AM(UTC)
Groups: Registered
Posts: 8
Here is a snippet of my code to receive defaults of a scanner's resolution:
twCapability.Cap = ICAP_XRESOLUTION;
twCapability.ConType = TWON_DONTCARE16;
twCapability.hContainer = NULL;
uFlags = LTWAIN_CAPABILITY_GETDEFAULT;
rc = L_TwainGetCapability( g_hSession, &twCapability, uFlags );
if (rc == SUCCESS) {
pValOneValue = (pTW_ONEVALUE)GlobalLock(twCapability.hContainer);
m_settings.nResolution = ((float)pValOneValue->Item);
GlobalUnlock(twCapability.hContainer);
fix32 = FloatToFix32((float)m_settings.nResolution );
nVal = (TW_UINT32)(&fix32);
TwainSetCapability( twCapability.Cap, TWAINNUMERICTYPE_TW_FIX32, nVal )) != SUCCESS) {
}
//Set capability
L_INT WCMScanning::TwainSetCapability( L_INT nCap, LTWAINNUMERICTYPE Type, L_UINT32 uValue )
{
L_INT nRet;
TW_CAPABILITY twCap;
do {
twCap.Cap = nCap;
twCap.ConType = TWON_ONEVALUE;
twCap.hContainer = NULL;
if ((nRet = L_TwainCreateNumericContainerOneValue( &twCap, Type, uValue )) != SUCCESS) {
break;
}
if ((nRet = L_TwainSetCapability( g_hSession, &twCap, LTWAIN_CAPABILITY_SET )) != SUCCESS) {
break;
}
}
while (false);
L_TwainFreeContainer( &twCap );
return nRet;
}
#4
Posted
:
Wednesday, May 24, 2006 10:24:49 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Can you please check the same issue the twacker.exe from www.twain.org
Use the following URL to download the Twacker: http://www.twain.org/devfiles/twack.zip
To check the valid values, you need to use the Twacker to check your twain driver ICAP_XRESOLUTION capability.
You can do this as follows:
- Run the Twack_32.exe application.
- Select menu "File"\"Select source" and select the twain driver that you want to use.
- Now, Select menu "Special"\"Load/Open SM".
- Select menu "Special"\"Open source"
- Select menu "Special"\"Send" (Send dialog appears).
- Within the send dialog, set the "Capability" option to ICAP_XRESOLUTION. And set the "MSG" option to "MSG_GET" then click the "Send" button at the bottom. You will notice the value of the XRESOLUTION in the "Structure" box.
Note: If you use the values that you get in the "Structure" box, your code should work with no problem.
- Now, change the "MSG" option to "MSG_SET" and set the XRESOLUTION value to the value that got from the previous step and click "Send" button. This should work. Now change the values to different values and check it.
Please recheck the same issue using the Twacker and let me know how it goes.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#5
Posted
:
Thursday, May 25, 2006 8:31:27 AM(UTC)
Groups: Registered
Posts: 8
Ok, I followed the steps that you layed out for me. Here is what I get : when I do a MSG_GET:
ItemType=TWTY_FIX32
NumItems=1
CurrentIndex=0
DefaultIndex=0
ItemList=100.00
When I do a MSG_SET ONEVALUE :
ItemType=TWTY_FIX32
Item=100
I received the same error: Return Code: TWRC_FAILURE. ConditionCode: TWCC_BADVALUE
By the way I dont know if this will help or not but i am using the Twain32 Sample Source driver.
I do not (so far) receive this kind of an error with any of my other scanners.
#6
Posted
:
Monday, May 29, 2006 7:01:55 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Do you mean that you are getting the error -568 only when you use the Twain32 Sample Source driver?
What is the exact twain driver that you used first?
However, since the same problem is active on the twacker, the problem is not related to LEADTOOLS Twain functions.
It might be related to the twain driver itself.
Please let me know how it goes.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.