当前位置:网站首页>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);
}

边栏推荐
- 报错解决 —— io.UnsupportedOperation: can‘t do nonzero end-relative seeks
- Django运行报错:Error loading MySQLdb module解决方法
- Request object and response object analysis
- Navicat 導出錶生成PDM文件
- Heating data in data lake?
- Database advanced learning notes -- SQL statement
- Tcp/ip protocol (UDP)
- @Controller, @service, @repository, @component differences
- Solve the problem of installing failed building wheel for pilot
- QT creator specify editor settings
猜你喜欢

安装numpy问题总结

Basic use of redis

QT creator design user interface

Deoldify project problem - omp:error 15:initializing libiomp5md dll,but found libiomp5md. dll already initialized.

AcWing 242. A simple integer problem (tree array + difference)

【博主推荐】C#MVC列表实现增删改查导入导出曲线功能(附源码)

Learning question 1:127.0.0.1 refused our visit

Asp access Shaoxing tourism graduation design website

【博主推荐】asp.net WebService 后台数据API JSON(附源码)

Learn winpwn (3) -- sEH from scratch
随机推荐
Request object and response object analysis
QT creator specify editor settings
安装numpy问题总结
One click extraction of tables in PDF
[蓝桥杯2017初赛]方格分割
[Thesis Writing] how to write function description of jsp online examination system
Antlr4 uses keywords as identifiers
数数字游戏
Basic use of redis
Asp access Shaoxing tourism graduation design website
安全测试涉及的测试对象
Idea import / export settings file
AcWing 1294. Cherry Blossom explanation
數據庫高級學習筆記--SQL語句
[number theory] divisor
软件测试-面试题分享
Heating data in data lake?
FRP intranet penetration
Leetcode 461 Hamming distance
AcWing 179. Factorial decomposition problem solution