// ------------------------------------------------------ // OnOK // // This is called when the user hits the "Finish" button // void CPrinterSetupWizardSheet::OnOK() { check ( m_selectedPrinter != NULL ); SetWizardButtons( PSWIZB_DISABLEDFINISH ); if ( InstallPrinter( m_selectedPrinter ) != kNoErr ) { CString caption; CString message; caption.LoadString(IDS_INSTALL_ERROR_CAPTION); message.LoadString(IDS_INSTALL_ERROR_MESSAGE); MessageBox(message, caption, MB_OK|MB_ICONEXCLAMATION); } StopBrowse(); }
// ------------------------------------------------------ // OnInitDialog // // Initializes this Dialog object. // BOOL CPrinterSetupWizardSheet::OnInitDialog() { OSStatus err; CPropertySheet::OnInitDialog(); err = StartBrowse(); require_noerr( err, exit ); exit: if ( err ) { StopBrowse(); if ( err == kDNSServiceErr_Firewall ) { CString text, caption; text.LoadString( IDS_FIREWALL ); caption.LoadString( IDS_FIREWALL_CAPTION ); MessageBox(text, caption, MB_OK|MB_ICONEXCLAMATION); } else { CPrinterSetupWizardSheet::WizardException exc; exc.text.LoadString( IDS_NO_MDNSRESPONDER_SERVICE_TEXT ); exc.caption.LoadString( IDS_ERROR_CAPTION ); throw(exc); } } return TRUE; }
BOOL CSecondPage::OnKillActive() { OSStatus err = kNoErr; if ( m_selected ) { CPrinterSetupWizardSheet * psheet; psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent()); require_quiet( psheet, exit ); psheet->SetSelectedPrinter( m_selected ); m_printers.remove( m_selected ); m_selected = NULL; } err = StopBrowse(); require_noerr( err, exit ); exit: return CPropertyPage::OnKillActive(); }
CSecondPage::~CSecondPage() { StopBrowse(); }