ScannerAvailable Example VC++

This example shows how to determine if TWAIN Scanning is available before you enable or disable scanning options within the application.

void CNewscanDlg::OnEnablescanning() 
{
    if(ImgScan1.ScannerAvailable())
        {
        m_mnuScanNewEnabled = TRUE;
        m_mnuScanAppendPageEnabled = TRUE;
        m_mnuScanInsertPageEnabled = TRUE;
        }
    // If ScannerAvailable returns False, disable scanner-related
    // menu options.
    else
        {
        m_mnuScanNewEnabled = FALSE;
        m_mnuScanAppendPageEnabled = FALSE;
        m_mnuScanInsertPageEnabled = FALSE;
        }
}