AcquireMulti Example for C++ 5.0 and later
void CRasterTwainSink::OnAcquireMultiEvent(short nPage, BSTR bstrFileName, BOOL bFinishScan)
{
CString csMsg;
CString csFileName(bstrFileName);
if (bFinishScan)
{
csMsg.Format(TEXT("The page # %d was scanned and saved to file %s\n"), nPage, csFileName);
AfxMessageBox(csMsg);
}
}
void CTwainView::OnTwainAcquire()
{
short iRet;
long lSize;
ILEADRasterTwain *pltRasTwain;
pltRasTwain->put_FileTransferName (CString("c:\\twain.bmp").AllocSysString());
pltRasTwain->get_MemBufSize(&lSize);
pltRasTwain->put_MemBufSize (lSize * 2);
pltRasTwain->put_EnableAcquireMultiEvent(TRUE);
iRet = pltRasTwain->AcquireMulti("c:\Twain\test.tif", L_LTWAIN_SHOW_USER_INTERFACE, TRUE);
if (iRet != 0)
MessageBox (TEXT("Error acquiring from source"));
}