图书馆管理系统 ODBC+ACCESS
自己写的数据库大作业,用MFC ODBC +access 写的 内含完整工程,解压后就能用 // MainFrm.cpp : implementation of the CMainFrame class // #include "stdafx.h" #include "ODBCdemo.h" #include "MainFrm.h" #include "BrwMessagedlg.h" #include "ReaderAdmindlg.h" #include "BookUpdatedlg.h" #include "LogIndlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMainFrame IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) //{{AFX_MSG_MAP(CMainFrame) ON_WM_CREATE() ON_COMMAND(ID_BCG, OnBcg) ON_COMMAND(IDD_ReaderUpdate, OnReaderUpdate) ON_COMMAND(IDBK_UPDATE, OnBookUpdate) //}}AFX_MSG_MAP END_MESSAGE_MAP() static UINT indicators[] = { ID_SEPARATOR, // status line indicator ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL, }; ///////////////////////////////////////////////////////////////////////////// // CMainFrame construction/destruction CMainFrame::CMainFrame() { // TODO: add member initialization code here m_bAutoMenuEnable=FALSE; } CMainFrame::~CMainFrame() { } int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } if (!m_wndDlgBar.Create(this, IDD_DIALOGBAR, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, IDD_DIALOGBAR)) { TRACE0("Failed to create dialogbar\n"); return -1; // fail to create } m_wndDlgBar.EnableDocking(CBRS_ORIENT_HORZ); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndDlgBar); CLogIndlg cdlg; if( cdlg.DoModal()==IDOK) { if(cdlg.role=="读者") { for(int i=0;iGetSubMenu(i)->EnableMenuItem(1,MF_BYPOSITION|MF_GRAYED); } } else DestroyWindow(); return 0; } BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return TRUE; } ///////////////////////////////////////////////////////////////////////////// // CMainFrame diagnostics #ifdef _DEBUG void CMainFrame::AssertValid() const { CFrameWnd::AssertValid(); } void CMainFrame::Dump(CDumpContext& dc) const { CFrameWnd::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CMainFrame message handlers void CMainFrame::OnBcg() { // TODO: Add your command handler code here CBrwMessagedlg cdlg; cdlg.DoModal(); } void CMainFrame::OnReaderUpdate() { // TODO: Add your command handler code here CReaderAdmindlg cdlg; cdlg.DoModal(); } void CMainFrame::OnBookUpdate() { // TODO: Add your command handler code here CBookUpdatedlg dlg; dlg.DoModal(); } BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) { // TODO: Add your specialized code here and/or call the base class if (m_wndDlgBar.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) return TRUE; return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo); } IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) //{{AFX_MSG_MAP(CMainFrame) ON_WM_CREATE() ON_COMMAND(ID_BCG, OnBcg) ON_COMMAND(IDD_ReaderUpdate, OnReaderUpdate) ON_COMMAND(IDBK_UPDATE, OnBookUpdate) //}}AFX_MSG_MAP END_MESSAGE_MAP() static UINT indicators[] = { ID_SEPARATOR, // status line indicator ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL, }; ///////////////////////////////////////////////////////////////////////////// // CMainFrame construction/destruction CMainFrame::CMainFrame() { // TODO: add member initialization code here m_bAutoMenuEnable=FALSE; } CMainFrame::~CMainFrame() { } int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } if (!m_wndDlgBar.Create(this, IDD_DIALOGBAR, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, IDD_DIALOGBAR)) { TRACE0("Failed to create dialogbar\n"); return -1; // fail to create } m_wndDlgBar.EnableDocking(CBRS_ORIENT_HORZ); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndDlgBar); CLogIndlg cdlg; if( cdlg.DoModal()==IDOK) { if(cdlg.role=="读者") { for(int i=0;iGetSubMenu(i)->EnableMenuItem(1,MF_BYPOSITION|MF_GRAYED); } } else DestroyWindow(); return 0; } BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return TRUE; } ///////////////////////////////////////////////////////////////////////////// // CMainFrame diagnostics #ifdef _DEBUG void CMainFrame::AssertValid() const { CFrameWnd::AssertValid(); } void CMainFrame::Dump(CDumpContext& dc) const { CFrameWnd::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CMainFrame message handlers void CMainFrame::OnBcg() { // TODO: Add your command handler code here CBrwMessagedlg cdlg; cdlg.DoModal(); } void CMainFrame::OnReaderUpdate() { // TODO: Add your command handler code here CReaderAdmindlg cdlg; cdlg.DoModal(); } void CMainFrame::OnBookUpdate() { // TODO: Add your command handler code here CBookUpdatedlg dlg; dlg.DoModal(); } BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) { // TODO: Add your specialized code here and/or call the base class if (m_wndDlgBar.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo)) return TRUE; return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo); }
文件列表
图书馆管理系统.rar
(预估有个84文件)
ODBCdemo
ReaderAdmindlg.cpp
5KB
ODBCdemo.dsw
524B
BookUpdatedlg.h
2KB
res
ODBCdemo.rc2
400B
ODBCdemoDoc.ico
1KB
ODBCdemo.ico
1KB
ODBCdemo.dsp
5KB
ODBCdemoDoc.cpp
2KB
用户评论