当前位置:网站首页>vs2019 使用向导生成一个MFC应用程序
vs2019 使用向导生成一个MFC应用程序
2022-07-06 09:14:00 【imxlw00】
创建项目
选择mfc模板
配置项目






运行

类视图

双击类名即可跳转到类声明所在的.h文件
下面为类中的成员函数,双击即可跳转到相应的定义部分

消息处理的添加

在CMainFrame添加消息处理,程序并没有反应,需要在view层操作上述过程。
在消息列表中找到WM_LBUTTONDOWN消息,添加。
工程文件增加几处改变。
第一处:在框架类头文件中添加了鼠标左键消息函数的函数声明
第二处:在框架类cpp文件中添加了消息映射宏
第三处:在框架列cpp文件中添加了处理鼠标左键消息的函数定义
void CMFCTestView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
CView::OnLButtonDown(nFlags, point);
CString str;
str.Format(TEXT("x=%d , y=%d "), point.x, point.y);
MessageBox(str);
}

边栏推荐
- 【博主推荐】C#MVC列表实现增删改查导入导出曲线功能(附源码)
- How to build a new project for keil5mdk (with super detailed drawings)
- 基于apache-jena的知识问答
- 安全测试涉及的测试对象
- Request object and response object analysis
- Heating data in data lake?
- Ansible practical Series II_ Getting started with Playbook
- AcWing 179. Factorial decomposition problem solution
- [Thesis Writing] how to write function description of jsp online examination system
- 报错解决 —— io.UnsupportedOperation: can‘t do nonzero end-relative seeks
猜你喜欢

A trip to Macao - > see the world from a non line city to Macao

How to configure flymcu (STM32 serial port download software) is shown in super detail

QT creator design user interface

图像识别问题 — pytesseract.TesseractNotFoundError: tesseract is not installed or it‘s not in your path

Summary of numpy installation problems

02-项目实战之后台员工信息管理

基于apache-jena的知识问答

One click extraction of tables in PDF
![[free setup] asp Net online course selection system design and Implementation (source code +lunwen)](/img/ac/b518796a92d00615cd374c0c835f38.jpg)
[free setup] asp Net online course selection system design and Implementation (source code +lunwen)

QT creator shape
随机推荐
double转int精度丢失问题
Julia 1.6 1.7 common problem solving
TCP/IP协议(UDP)
解决安装Failed building wheel for pillow
01 project demand analysis (ordering system)
AcWing 1298. Solution to Cao Chong's pig raising problem
L2-004 这是二叉搜索树吗? (25 分)
数据库高级学习笔记--SQL语句
[number theory] divisor
QT creator design user interface
记一次某公司面试题:合并有序数组
A trip to Macao - > see the world from a non line city to Macao
JDBC principle
Swagger、Yapi接口管理服务_SE
Number game
Ubuntu 20.04 安装 MySQL
Request object and response object analysis
[ahoi2009]chess Chinese chess - combination number optimization shape pressure DP
csdn-Markdown编辑器
FRP intranet penetration