// ErrorList.cpp : implementation file // #include "stdafx.h" #include "TwainDemo.h" #include "ErrorList.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CErrorList dialog CErrorList::CErrorList(CWnd* pParent /*=NULL*/) : CDialog(CErrorList::IDD, pParent) { //{{AFX_DATA_INIT(CErrorList) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CErrorList::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CErrorList) DDX_Control(pDX, IDC_LIST_TWAIN_ERROR_LIST, m_lstErrors); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CErrorList, CDialog) //{{AFX_MSG_MAP(CErrorList) ON_BN_CLICKED(IDC_BUTTON_CLEAR_LIST, OnButtonClearList) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CErrorList message handlers BOOL CErrorList::OnInitDialog() { CDialog::OnInitDialog(); CTwainDemoApp * pApp = (CTwainDemoApp *)AfxGetApp(); int nCount = pApp->m_ErrorsList.GetSize(); for (int i=0; im_ErrorsList[i]); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CErrorList::OnButtonClearList() { CTwainDemoApp * pApp = (CTwainDemoApp *)AfxGetApp(); pApp->m_ErrorsList.RemoveAll(); m_lstErrors.ResetContent(); }