--- h6-udlÃ¥nssystemDlg.cpp 2006/08/30 21:57:57 9 +++ h6-udlÃ¥nssystemDlg.cpp 2006/09/05 12:50:38 41 @@ -1,5 +1,7 @@ -// h6-udlånssystemDlg.cpp : implementation file -// +/* + * Developed by Torben H. Nielsen + */ + #include "stdafx.h" #include "h6-udlånssystem.h" @@ -8,6 +10,8 @@ #include "commonstorage.h" #include "databaselayer.h" +#include "microsoftdblayer.h" +#include "mysqllayer.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -76,6 +80,7 @@ BOOL Ch6udlnssystemDlg::OnInitDialog() { CDialog::OnInitDialog(); + CWaitCursor wait; // Add "About..." menu item to system menu. @@ -107,8 +112,16 @@ m_tabs.SetCurSel(0); - DatabaseLayer *dbl = new DatabaseLayer; - CommonStorage::Instance()->setDBLayer(dbl); + try { + //DatabaseLayer *dbl = new DatabaseLayer; + DatabaseLayer *dbl = new MySQLLayer; + 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 @@ -167,7 +180,8 @@ void Ch6udlnssystemDlg::OnHelpAbout() { - MessageBox("DA6H :: Udlånssystem\r\nLavet af:\r\nKevin, Hedin & Torben"); + CAboutDlg about; + about.DoModal(); } void Ch6udlnssystemDlg::OnFileExit()