--- h6-udlånssystemDlg.cpp 2006/08/30 21:57:57 9 +++ h6-udlånssystemDlg.cpp 2006/09/03 09:19:06 30 @@ -76,6 +76,7 @@ BOOL Ch6udlnssystemDlg::OnInitDialog() { CDialog::OnInitDialog(); + CWaitCursor wait; // Add "About..." menu item to system menu. @@ -107,8 +108,15 @@ m_tabs.SetCurSel(0); - DatabaseLayer *dbl = new DatabaseLayer; - CommonStorage::Instance()->setDBLayer(dbl); + try { + DatabaseLayer *dbl = new DatabaseLayer; + CommonStorage::Instance()->setDBLayer(dbl); + } catch (...) { + MessageBox(CString("Could not establish connection to the database server\r\n") + + "Please contact your network administrator\r\n" + + "(This application shuts down automatically)"); + OnOK(); + } // TODO: Add extra initialization here