Home › Forums › TWAIN Classic › a implementation question of the C# Tool API
- This topic has 1 reply, 2 voices, and was last updated 9 years, 10 months ago by MarkM.
- AuthorPosts
in TWAINWorkingGroupToolkit.ScanCallback, there is no to do with DG_CONTROL/DAT_PENDINGXFERS/MSG_ENDXFER, why?
There are updates coming for the project, including changes that help make ScanCallback easier to use, like an unambiguous indication about the end of a scanning session, and access to the filename when file transfers are being used. I just need time to upload them…
The Toolkit layer is a convenience library. As such it tries to hide as much unnecessary detail from the application layer as possible. There’s no reason for an application writer to have to worry about making that call. Having said that, the following does appear inside of the ScanCallback function…
***********************
// Tell TWAIN that we’re done with this image, this is the one place
// that we go downstate without using the Rollback function, so that
// we can examine the TW_PENDINGXFERS structure…
TWAIN.TW_PENDINGXFERS twpendingxfers = default(TWAIN.TW_PENDINGXFERS);
sts = m_twain.DatPendingxfers(TWAIN.DG.CONTROL, TWAIN.MSG.ENDXFER, ref twpendingxfers);
if (sts != TWAIN.STS.SUCCESS)
{
WriteOutput(“Scanning error: ” + sts + Environment.NewLine);
m_twain.Rollback(m_stateAfterScan);
ShowImage(CvtSts(sts),null,null);
return (TWAIN.STS.SUCCESS);
}
***********************- AuthorPosts