资源简介
该资源是学生对MFC、C++和数据结构的实践,需求为实现画矩形和画直线,然后实现裁剪、颜色选取、清空功能。
程序添加了注释,看起来层次非常清晰。
代码片段和文件信息
// DrawRectangle.cpp : Defines the class behaviors for the application.
//
#include “stdafx.h“
#include “DrawRectangle.h“
#include “MainFrm.h“
#include “DrawRectangleDoc.h“
#include “DrawRectangleView.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDrawRectangleApp
BEGIN_MESSAGE_MAP(CDrawRectangleApp CWinApp)
//{{AFX_MSG_MAP(CDrawRectangleApp)
ON_COMMAND(ID_APP_ABOUT OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDrawRectangleApp construction
CDrawRectangleApp::CDrawRectangleApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CDrawRectangleApp object
CDrawRectangleApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CDrawRectangleApp initialization
BOOL CDrawRectangleApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T(“Local AppWizard-Generated Applications“));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application‘s document templates. Document templates
// serve as the connection between documents frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINframe
RUNTIME_CLASS(CDrawRectangleDoc)
RUNTIME_CLASS(CMainframe) // main SDI frame window
RUNTIME_CLASS(CDrawRectangleView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands DDE file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initial
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 44696 2011-04-27 10:59 DrawLine\DrawRectangle.aps
文件 2530 2011-04-28 09:21 DrawLine\DrawRectangle.clw
文件 4335 2011-04-26 17:41 DrawLine\DrawRectangle.cpp
文件 4758 2011-04-28 09:18 DrawLine\DrawRectangle.dsp
文件 534 2011-04-26 17:41 DrawLine\DrawRectangle.dsw
文件 1433 2011-04-26 17:41 DrawLine\DrawRectangle.h
文件 74752 2011-04-28 09:21 DrawLine\DrawRectangle.ncb
文件 50688 2011-04-28 09:21 DrawLine\DrawRectangle.opt
文件 1220 2011-04-28 09:20 DrawLine\DrawRectangle.plg
文件 12205 2011-04-27 10:59 DrawLine\DrawRectangle.rc
文件 1882 2011-04-26 17:41 DrawLine\DrawRectangleDoc.cpp
文件 1552 2011-04-26 17:41 DrawLine\DrawRectangleDoc.h
文件 11230 2011-04-28 09:20 DrawLine\DrawRectangleView.cpp
文件 2796 2011-04-28 09:16 DrawLine\DrawRectangleView.h
文件 103 2011-04-28 07:39 DrawLine\Line.h
文件 2514 2011-04-26 17:41 DrawLine\MainFrm.cpp
文件 1581 2011-04-26 17:41 DrawLine\MainFrm.h
文件 4479 2011-04-26 17:41 DrawLine\ReadMe.txt
文件 1078 2011-04-26 17:41 DrawLine\res\DrawRectangle.ico
文件 405 2011-04-26 17:41 DrawLine\res\DrawRectangle.rc2
文件 1078 2011-04-26 17:41 DrawLine\res\DrawRectangleDoc.ico
文件 1078 2011-04-27 10:52 DrawLine\res\Toolbar.bmp
文件 835 2011-04-27 10:59 DrawLine\resource.h
文件 215 2011-04-26 17:41 DrawLine\StdAfx.cpp
文件 1054 2011-04-26 17:41 DrawLine\StdAfx.h
目录 0 2011-04-27 10:52 DrawLine\res
目录 0 2011-04-28 09:21 DrawLine
文件 119477 2011-04-26 17:33 实验三.pdf
----------- --------- ---------- ----- ----
348508 28
............此处省略1个文件信息
- 上一篇:VC++使用SQL查询操作数据库
- 下一篇:c语言编写的置换密码源代码
相关资源
- MFC socket编程MyQQ
- 基于MFC实现的FTP断点续传客户端
- MFC日志类
- MFC单文档画图(直线矩形有注释)
- 简单的MFC串口通讯 源代码
- MFC学生简单信息管理程序设计文档
- 语音识别MFCC特征提取matlab代码
- MFC单文档心电图模拟程序vc6.0
- VS2010使用MFC编写闹钟和定时关机程序
- MFC 贪吃蛇
- SDNU 面向对象程序设计及C++ MFC 期中作
- 远程文件--select模式
- MFC日志写入与读取
- Windows MFC排序演示过程
- c++/MFC CSocket仿QQ聊天软件,实现1对1聊
- C++PCM音频格式录音双缓存MFC版本
- mfc 实现图片的移动 火箭移动效果
- MFC中如何使用子控件向父控件发送自
- MFC基于TCP/IP协议的聊天室源代码 (继
- mfc高通滤波器
- MFC对EXCEL的操作:修改单元格格式,背
- MFC的一个很强大的LIstCtrl类很漂亮,类
- MFCC参数提取的matlab实现
- 基于udp的P2P聊天工具MFC实现
- 基于MFC的连接数据库的书店管理系统
- VS2013 MFC ODBC连接SQL SERVER数据库编程完
-
MFC ba
se64编码/解码工具 - mstcpip头文件
- 自己写的一个MFC画线程序,可以设置
- VS2012+MFC串口通信
评论
共有 条评论