云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 面向对象程序设计课程设计报告《电子时钟》(C++)

面向对象程序设计课程设计报告《电子时钟》(C++)

  • 62 次阅读
  • 3 次下载
  • 2025/12/11 1:04:27

END_MESSAGE_MAP() CDateTimeApp::CDateTimeApp() { }

CDateTimeApp theApp;

BOOL CDateTimeApp::InitInstance() {

AfxEnableControlContainer(); #ifdef _AFXDLL Enable3dControls();

// Call this when using MFC in a shared DLL

#else

Enable3dControlsStatic(); // Call this when linking to MFC statically

#endif 幕中央

8

SetRegistryKey(_T(\

LoadStdProfileSettings(); // Load standard INI file options (including MRU) CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate(

IDR_MAINFRAME,

RUNTIME_CLASS(CDateTimeDoc),

RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CDateTimeView));

AddDocTemplate(pDocTemplate); CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); if (!ProcessShellCommand(cmdInfo)) return FALSE;

m_pMainWnd->ShowWindow(SW_SHOW); m_pMainWnd->UpdateWindow();

m_pMainWnd->SetWindowPos(NULL,0,0,400,250,SWP_SHOWWINDOW); AfxGetMainWnd()->CenterWindow(CWnd::GetDesktopWindow());//窗口置屏

}

return TRUE;

class CAboutDlg : public CDialog //对话框类,负责设置时间 { public: };

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { }

void CAboutDlg::DoDataExchange(CDataExchange* pDX) { }

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) END_MESSAGE_MAP()

void CDateTimeApp::OnAppAbout() { }

// DateTimeDoc.h文件,文档类,定义了文字信息的属性

#if !defined(AFX_DATETIMEDOC_H__7CB32F09_D9D2_4ABD_87CA_F51383AFDC67__INCLUDED_)

#define

AFX_DATETIMEDOC_H__7CB32F09_D9D2_4ABD_87CA_F51383AFDC67__INCLU

9

CAboutDlg();

enum { IDD = IDD_ABOUTBOX }; protected:

virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support protected:

DECLARE_MESSAGE_MAP()

CDialog::DoDataExchange(pDX);

CAboutDlg aboutDlg; aboutDlg.DoModal();

DED_

#if _MSC_VER > 1000 #pragma once

#endif // _MSC_VER > 1000

class CDateTimeDoc : public CDocument { protected:

CDateTimeDoc();

DECLARE_DYNCREATE(CDateTimeDoc)

public:

int year,month,day,hour,minute,second; //定义int型变量用以计算时间 CString str_year,str_month,str_day,str_hour,str_minute,str_second; //定义

CString型变量用以显示

CString str1,str2,str3; public:

virtual BOOL OnNewDocument(); virtual void Serialize(CArchive& ar);

public:

virtual ~CDateTimeDoc();

#ifdef _DEBUG

virtual void AssertValid() const;

virtual void Dump(CDumpContext& dc) const;

#endif protected: protected: }; #endif

// DateTimeDoc.cpp 文件 #include \

10

DECLARE_MESSAGE_MAP()

#include \#include \#ifdef _DEBUG

#define new DEBUG_NEW #undef THIS_FILE

static char THIS_FILE[] = __FILE__; #endif

IMPLEMENT_DYNCREATE(CDateTimeDoc, CDocument) BEGIN_MESSAGE_MAP(CDateTimeDoc, CDocument) END_MESSAGE_MAP() CDateTimeDoc::CDateTimeDoc() {

day=1;month=0;year=110;hour=0;minute=0;second=0;

str_year=\

\

}

CDateTimeDoc::~CDateTimeDoc() { }

BOOL CDateTimeDoc::OnNewDocument() { }

void CDateTimeDoc::Serialize(CArchive& ar) {

if (!CDocument::OnNewDocument())

return FALSE;

return TRUE;

if (ar.IsStoring()) {

}

else {

}

11

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

END_MESSAGE_MAP() CDateTimeApp::CDateTimeApp() { } CDateTimeApp theApp; BOOL CDateTimeApp::InitInstance() { AfxEnableControlContainer(); #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif 幕中央

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com