This example illustrates one technique for scanning a new file.
void CNewscanDlg::OnScannew()
{
// Using the Admin Control Save As dialog box to allow user
// to specify a filename for the new file.
VARIANT vhWnd; V_VT(&vhWnd) = VT_I4;
V_I4(&vhWnd) = (long)m_hWnd;
ImgAdmin1.ShowFileDialog (1,vhWnd); //SaveDlg
// Set the Scan control's image property to the new filename.
ImgScan1.SetImage (ImgAdmin1.GetImage());
// Scan a new file using the Scan New Dialog box
// Note: You do not need to set the Image property before you
// call the dialog box. It may be set in the dialog box if desired.
VARIANT vModal; V_VT(&vModal) = VT_BOOL;
V_BOOL(&vModal) = TRUE;
ImgScan1.ShowScanNew(vModal);
}
void CNewscanDlg::OnFileNameRequestScanctrl1(long PageNumber)
{
if(PageNumber > m_iPagesPerFile)
// intPageCount will be used to sequentially increment file names
m_iPageCount++;
// Filename is comprised of 4 digit month/day and 4 digit sequential number
CString szName;
szName.Format("D:\\image2\\%n",m_iPageCount);
szName += ".tif";
ImgScan1.SetImage (szName);
}