收藏 分销(赏)

课程设计论文.doc

上传人:仙人****88 文档编号:12071311 上传时间:2025-09-06 格式:DOC 页数:11 大小:69.50KB 下载积分:10 金币
下载 相关
课程设计论文.doc_第1页
第1页 / 共11页
课程设计论文.doc_第2页
第2页 / 共11页


点击查看更多>>
资源描述
尹能 《小区住户信息管理系统》 第11页 共11页 设计源程序清单 #include "stdafx.h" #include "住户管理系统.h" #include "MainFrm.h" #include "住户管理系统Doc.h" #include "住户管理系统View.h" #include <initguid.h> #include "住户管理系统_i.c" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif BEGIN_MESSAGE_MAP(CMyApp, CWinApp) ON_COMMAND(ID_APP_ABOUT, OnAppAbout) ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup) END_MESSAGE_MAP() CMyApp::CMyApp() { } CMyApp theApp; BOOL CMyApp::InitInstance() { if (!InitATL()) return FALSE; AfxEnableControlContainer(); #ifdef _AFXDLL Enable3dControls(); #else Enable3dControlsStatic(); #endif SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(); CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMyDoc), RUNTIME_CLASS(CMainFrame), RUNTIME_CLASS(CMyView)); AddDocTemplate(pDocTemplate); CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated) { return TRUE; } if (!ProcessShellCommand(cmdInfo)) return FALSE; m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow(); return TRUE; } class CAboutDlg : public CDialog { public: CAboutDlg(); enum { IDD = IDD_ABOUTBOX }; protected: virtual void DoDataExchange(CDataExchange* pDX); protected: DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) END_MESSAGE_MAP() void CMyApp::OnAppAbout() { CAboutDlg aboutDlg; aboutDlg.DoModal(); } CMyModule _Module; BEGIN_OBJECT_MAP(ObjectMap) END_OBJECT_MAP() LONG CMyModule::Unlock() { AfxOleUnlockApp(); return 0; } LONG CMyModule::Lock() { AfxOleLockApp(); return 1; } LPCTSTR CMyModule::FindOneOf(LPCTSTR p1, LPCTSTR p2) { while (*p1 != NULL) { LPCTSTR p = p2; while (*p != NULL) { if (*p1 == *p) return CharNext(p1); p = CharNext(p); } p1++; } return NULL; } int CMyApp::ExitInstance() { if (m_bATLInited) { _Module.RevokeClassObjects(); _Module.Term(); CoUninitialize(); } return CWinApp::ExitInstance(); } BOOL CMyApp::InitATL() { m_bATLInited = TRUE; #if _WIN32_WINNT >= 0x0400 HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED); #else HRESULT hRes = CoInitialize(NULL); #endif if (FAILED(hRes)) { m_bATLInited = FALSE; return FALSE; } _Module.Init(ObjectMap, AfxGetInstanceHandle()); _Module.dwThreadID = GetCurrentThreadId(); LPTSTR lpCmdLine = GetCommandLine(); TCHAR szTokens[] = _T("-/"); BOOL bRun = TRUE; LPCTSTR lpszToken = _Module.FindOneOf(lpCmdLine, szTokens); while (lpszToken != NULL) { if (lstrcmpi(lpszToken, _T("UnregServer"))==0) { _Module.UpdateRegistryFromResource(IDR_MY, FALSE); _Module.UnregisterServer(TRUE); bRun = FALSE; break; } if (lstrcmpi(lpszToken, _T("RegServer"))==0) { _Module.UpdateRegistryFromResource(IDR_MY, TRUE); _Module.RegisterServer(TRUE); bRun = FALSE; break; } lpszToken = _Module.FindOneOf(lpszToken, szTokens); } if (!bRun) { m_bATLInited = FALSE; _Module.Term(); CoUninitialize(); return FALSE; } hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE); if (FAILED(hRes)) { m_bATLInited = FALSE; CoUninitialize(); return FALSE; } return TRUE; } #if !defined(AFX_STDAFX_H__483D5902_B6F6_44D7_8C03_CA16BD202818__INCLUDED_) #define AFX_STDAFX_H__483D5902_B6F6_44D7_8C03_CA16BD202818__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define VC_EXTRALEAN #include <afxwin.h> #include <afxext.h> #include <afxdisp.h> #include <afxdtctl.h> #ifndef _AFX_NO_AFXCMN_SUPPORT #include <afxcmn.h> #endif #define _ATL_APARTMENT_THREADED #include <atlbase.h> class CMyModule : public CComModule { public: LONG Unlock(); LONG Lock(); LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2); DWORD dwThreadID; }; extern CMyModule _Module; #include <atlcom.h> #include <atldbcli.h> typedef struct user{ CString strName; CString strSectionname; int nBuildingnum; int nCellnum; int nRoomnum; CString strHouseTel; CString strOffice; CString strOfficeTel; CString strBeeppager; CString strMobile; CString strEmail; HTREEITEM hItem; } USER; #if !defined(AFX__H__25F512A0_43D5_4305_9320_094CAF711563__INCLUDED_) #define AFX__H__25F512A0_43D5_4305_9320_094CAF711563__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH #endif #include "resource.h" #include "住户管理系统_i.h" ///////////////////////////////////////////////////////////////////////////// class CMyApp : public CWinApp { public: CMyApp(); public: virtual BOOL InitInstance(); virtual int ExitInstance(); afx_msg void OnAppAbout(); DECLARE_MESSAGE_MAP() private: BOOL m_bATLInited; private: BOOL InitATL(); }; #if !defined(AFX_MAINFRM_H__E3A6002B_0354_4316_A925_471B0C72330C__INCLUDED_) #define AFX_MAINFRM_H__E3A6002B_0354_4316_A925_471B0C72330C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 //定义右边视的类型 #define USERSVIEW 0 #define USERINFOVIEW 1 #define WRONGVIEW -1 class CLeftTreeView; class CUserinfoView; class CUsersListView; class CMainFrame : public CFrameWnd { protected: CMainFrame(); DECLARE_DYNCREATE(CMainFrame) public: CLeftTreeView* m_pLeftView; //树视图 CUsersListView* m_pUsersView; //住户列表视图 CUserinfoView* m_pUserinfoView; //住户详细信息视图 public: virtual BOOL PreCreateWindow(CREATESTRUCT& cs); public: void SwitchToView(int nViewType); virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); virtual ~CMainFrame(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: CStatusBar m_wndStatusBar; CToolBar m_wndToolBar; protected: CSplitterWnd m_wndSplitter; afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnOperateAdduser(); afx_msg void OnOperateQuery(); DECLARE_MESSAGE_MAP() }; #if !defined(AFX_DOC_H__02131BA6_D967_47F2_8EB9_D01C557AF9E9__INCLUDED_) #define AFX_DOC_H__02131BA6_D967_47F2_8EB9_D01C557AF9E9__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "house.H" class CMyDoc : public CDocument { protected: CMyDoc(); DECLARE_DYNCREATE(CMyDoc) public: // Operations public: public: virtual BOOL OnNewDocument(); virtual void Serialize(CArchive& ar); public: BOOL DeleteUser(CString strSql); int AddUser(USER &user); virtual void DeleteContents(); Chouse m_dbHouse; virtual ~CMyDoc(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: protected: DECLARE_MESSAGE_MAP() }; #if !defined(AFX_VIEW_H__716A0CEB_AFB6_41BE_8102_0349ECF38AD3__INCLUDED_) #define AFX_VIEW_H__716A0CEB_AFB6_41BE_8102_0349ECF38AD3__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 class CMyView : public CView { protected: CMyView(); DECLARE_DYNCREATE(CMyView) public: CMyDoc* GetDocument(); public: public: virtual void OnDraw(CDC* pDC); virtual BOOL PreCreateWindow(CREATESTRUCT& cs); protected: virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); public: virtual ~CMyView(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // Generated message map functions protected: DECLARE_MESSAGE_MAP() }; #ifndef _DEBUG // debug version in 住户管理系统View.cpp inline CMyDoc* CMyView::GetDocument() { return (CMyDoc*)m_pDocument; } #endif #ifdef __cplusplus extern "C"{ #endif #ifndef __IID_DEFINED__ #define __IID_DEFINED__ typedef struct _IID { unsigned long x; unsigned short s1; unsigned short s2; unsigned char c[8]; } IID; #endif #ifndef CLSID_DEFINED #define CLSID_DEFINED typedef IID CLSID; #endif const IID LIBID_MyLib = {0xBC7E0972,0xBC75,0x4632,{0xA9,0xA1,0xE8,0xDA,0xFE,0x52,0xC9,0xDB}}; #ifdef __cplusplus } #endif
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 学术论文 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服