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; 
	
	pltRasTwain->UnlockSupport(L_SUPPORT_DOCUMENT, TEXT("test key"));
	pltRasTwain->InitSession ((long)GetSafeHwnd());
	pltRasTwain->SelectSource();
	pltRasTwain->FastTransferMode = L_LTWAIN_BUFFER_MODE;
	pltRasTwain->FastFormat = FILE_TIF;
	pltRasTwain->FastBitsPerPixel = 1;
	pltRasTwain->FastBufferSize = 0;
	pltRasTwain->FastUsePreferredBufferSize = TRUE;
	pltRasTwain->EnableAcquireMultiEvent = TRUE;

	iRet = pltRasTwain->AcquireMulti("c:\\test.tif", L_LTWAIN_SHOW_USER_INTERFACE, TRUE);
	if (iRet != 0) 
		MessageBox (TEXT("Error acquiring from source"));
}