Home › Forums › TWAIN Classic › Moving from TWAIN 1.8 to 1.9
- This topic has 1 reply, 2 voices, and was last updated 16 years, 10 months ago by gabe.
- AuthorPosts
All.
I am hoping you can help me. I openly admit to not having a fully functional knowledge of the TWAIN interface…
I have just started supporting an application that provided picture capture from devices that support the TWAIN 1.8 interface. The customer for the product has purchased a device that supports the 1.9 interface (Kodak i40 scanner) and the image capturing process no longer works. I did not initially write the TWAIN support for the product but have been tasked with attempting to move support up to the new interface version. When debugging the product the following function fails for the 1.9 product and works for the 1.8 product. The 1.8 supported device (Logitech web cam) has a ‘m_returnCode’ of 6 (which maps to TWRC_XFERDONE) and the 1.9 supported device has a ‘m_returnCode’ of 1 (which maps to TWRC_FAILURE). Essentially what I would like to know is if there is anything I am doing wrong in the ‘CallTwainProc’ line of code that would function in the older TWAIN interface:
bool CTwain::GetImage(TW_IMAGEINFO& info)
{
HANDLE hBitmap;
CallTwainProc(&m_AppId, &m_Source, DG_IMAGE, DAT_IMAGENATIVEXFER, MSG_GET, &hBitmap);
switch (m_returnCode)
{
case TWRC_XFERDONE:
CopyImage(hBitmap,info);
break;
case TWRC_CANCEL:
AbortScan();
break;
case TWRC_FAILURE:
CancelTransfer();
return false;
}
GlobalFree(hBitmap);
return EndTransfer();
}
Any help or suggested links would be very gratefully received from a very confused developer J
Thanks in advance.
check the condition code. rc = failure with cc = success means success. And I’ve seem it on an i65.
If you have the time, review all of your code where you get an rc = failure then make a decision without checking the cc. The rc is only half of the story.
- AuthorPosts