MFC消息映射机制

VCS的增量和分离编译 vcs的增量和分离编译 阅读详情
消息映射机制
    将win32中的消息处理函数的switch-case结构进行优化,一个消息对应一个处理函数。
   消息映射的实现
       在类的定义中添加消息映射的声明宏
            DECLARE_MESSAGE_MAP
       在类的实现中添加消息映射实现宏
            BEGIN_MESSAGE_MAP(theClass,baseClass)
                ON_MESSAGE(msgID,msgFun)
            END_MESSAGE_MAP
      添加消息处理函数msgFun()的定义和实现

【WRF-Chem第二期】WRF-Chem有关 namelist 详解 阅读详情

相关推荐

django安装mysqlclient (Windows下正确安装mysqlclient)

由于本人也是初学Python和django。本人使用的Python版本是3.7所以连接MySQL数据库需要安装数据驱动,对应Python3的数据驱动是mysqlclient。因此本人习惯性的使用命令pip install mysqlclient,结果安装失败 (venv) C:\Users\songlihui\PycharmProjects\autotest>pip install my...

songlh1234的博客 2万+

MFC 消息类型详解

原文来自:http://blog.tianya.cn/blogger/post_show.asp?BlogID=554498&PostID=8872182   1、命令消息(WM_COMMAND)   所有派生自 CCmdTarget 的类都有资格接受WM_COMMAND。      2、Window消息(WM_xxx)   所有派生自 CWnd 的类都有资格接受 WM_xxx。

探索。。。发现。。。 1219

基于STM32的便携式心率血氧监测系统 | 保姆式教程 开源可复刻

本项目基于STM32F103C8T6核心控制器,完整实现了便携式心率血氧监测系统的全功能开发,覆盖MAX30102光电传感器驱动、PPG信号处理、心率血氧解算算法、人机交互、数据存储、报警保护、低功耗管理等核心功能,全程采用无跳步保姆式教学,从硬件选型、接线、CubeMX配置、代码开发、调试优化全流程拆解,跟着步骤一步步操作,就能顺利完成项目复刻

ZhongWeiXiang9的博客 767

MFC的消息映射原理

本文要求对C++语法比较熟悉(特别是虚函数的使用),若不熟悉建议参阅《C++语法详解》一书,电子工业出版社出版 1、消息映射:就是把指定的消息交给指定的函数进行处理的方法,这样就形成了一个<消息,处理函数>对。 2、本文有时会使用<M,F>表示<消息,处理函数>对。 一、共用体(union)的使用 1、共用体可以实现以下两个功能(详见示例说明)。 1)、调用函数...

Szh8888的博客 442

利用ArcGIS快速生成等高线边界,完成地形图拼图

地形图边界一般在CAD中手动绘制,然而,一幅边缘复杂的地形图边界的绘制需要花费大量时间和精力,为了减少重复性工作,提高效率,用ArcGIS软件可以自动生成实测地形图的边界

yl14774636230的博客 9068

初探Proxmox Datacenter Manager:统一管理多集群与单节点的利器

本文介绍了Proxmox Datacenter Manager (PDM) 这一统一管理工具,它能有效解决多套Proxmox VE环境(包括集群和单节点)管理碎片化的痛点。文章详细阐述了PDM的核心功能、安装部署步骤,并通过实战演示了如何添加单节点与整个集群,实现资源的集中监控与基础运维,为运维人员提供了高效的集中管理解决方案。

weixin_29217235的博客 160

【MFC】消息映射机制

MFC消息映射机制 总所周知,Windows应用程序都是消息驱动的在MFC软件开发中,界面操作或者线程之间通信都会经常用到消息,通过对消息的处理实现相应的操作。比较典型的过程是,用户操作窗口,然后有消息产生,送给窗口的消息处理函数处理,对用户的操作做出响应。 今天就来简单聊一聊MFC中的消息映射机制。 第一步:用户通过标准输入发送消息给操作系统。 第二步:操作系统将消息丢进消息队列中,进行排队。 第三步:响应的应用程序得到消息,也就是GetMessage(); 第四步:应用程序会发送消息(不含组合键).

Cain Xcy的博客 3166

QSPI Flash的原理与QSPI时序的Verilog实现

本节主要是讨论QSPI(Quad SPI,四线SPI总线)的相关内容。我的开发板上有一片型号是W25Q128BV的Quad SPI Flash存储器,本文将以它为例子来说明QSPI操作的一些内容。

Go Forward Forever! 4166

MFC 消息映射机制

MFC 消息映射机制详解

qq_61553520的博客 2400

工业级Modbus ASCII实时监控系统(WinForms完整实现)

本文介绍了一个基于WinForms的工业级Modbus ASCII实时监控系统实现方案。该系统采用经典工控界面布局,包含串口配置、数据采集控制和实时数据显示三大区域。核心功能包括:串口通信参数设置、Modbus从站地址配置、寄存器数据采集、实时数据表格展示和趋势图绘制。系统通过ModbusAsciiClient类实现通信核心,采用定时器轮询机制采集数据,支持最多100个数据点的历史趋势显示。界面设计注重用户体验,配置区位于左侧,主显示区在右侧,底部为状态和日志区,符合工业控制系统的操作习惯。代码示例展示了窗

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 278

【Java开发者必看】LangChain4j实战指南:使用AIService轻松集成聊天记忆Chat Memory到SpringBoot应用,通过封装多轮复杂对话,使聊天记忆的实现变得简单

聊天记忆是指在与用户的多轮对话过程中,能够记住之前的交互内容,从而提供更加连贯和个性化的回复。LangChain4j支持通过ChatMemoryProvider接口实现聊天记忆功能。

Spring Boot-Common On With You 448

MFC的消息映射机制

MFC的消息映射机制 添加消息处理函数不管是自动还是手动添加都有三个步骤: 1.在类定义中加入消息处理函数的函数声明,以afx_msg开头。例如MainFrm.h中WM_CREATE的消息处理函数的函数声明: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 2.在类的消息映射表中添加该消息的消息映射入口项。例如WM_CREATE的消息映射...

weixin_43389386的博客 521

【学习系列】SAP RAP 17:RAP应用部署集成至Fiori Launchpad 【S4HC Public Edition】

本文详细介绍了在SAP S/4HANA Cloud环境中部署RAP应用集成到Fiori Launchpad的两种方法:使用BAS(SAP Business Application Studio)和VSCode。主要步骤包括:1)在BTP中配置Destination连接ES环境;2)设置信任关系;3)创建BAS开发空间;4)通过Fiori应用生成器部署RAP应用;5)创建IAM App、Business Catalog和Business Role;6)配置Launchpad Space和Pages。文章还提供

DeveloperMrMeng的博客 961

MFC的消息处理与消息映射机制

在MFC中,框架类(CFrameWnd)代表着Windows中一个窗口,它负责窗口的注册和创建,并可以将控件包括按钮、菜单、工具栏等都可以挂载在CFrameWnd中。它功能非常强大,管理着窗口的一切。本文将通过pFrame来详细研究MFC是如何进行消息处理的。

qq_43725310的博客 3498

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

MFC中消息映射机制分析

 摘  要:MFC以层次结构组织起来,比较庞杂,尤其是它的消息映射机制,更是涉及到很多底层的东西。本文通过对整个消息映射机制进行系统的分析,可以帮助程序开发人员更好地了解MFC,进行可视化编程。关键词:消息驱动;消息映射;MFC 程序设计1 引言微软公司提供的MFC基本类库(Microsoft Foundation Classes),是进行可视化编程时使用最为流行的一个类库。MFC封装

水上漂的专栏 1278

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【上位机——MFC】消息映射机制

【上位机——MFC】消息映射机制

weixin_39723539的博客 914

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

[MFC] 消息映射机制的使用和原理浅析

MFC消息映射机制的研究。如何使用消息映射、消息映射的原理分析。

zlllc的博客 3234

MFC编程入门之五(MFC消息映射机制概述)

在MFC软件开发中,界面操作或者线程之间通信都会经常用到消息,通过对消息的处理实现相应的操作。 比较典型的过程是,用户操作窗口,然后有消息产生,送给窗口的消息处理函数处理,对用户的操作做出响应。 一、什么是消息?   窗口消息一般由三个部分组成:1、一个无符号整数,是消息值;2、消息附带的WPARAM类型的参数;3、消 息附带的LPARAM类型的参数。其实,我们一般所说的消息是侠义上的消息值,...

acoolgiser的博客 418

MFC消息映射机制详解

Windows程序和MFC程序是靠消息驱动的,他们对于消息的处理本质上是相同的。只是Windows程序对于消息处理的过程十分清晰明了,MFC程序则掩盖了消息处理的过程,以消息映射的方式呈现在开发者面前,使得开发消息的处理十分简单。用多了mfc就想对它的消息映射机制有一个本质的了解,下面将对消息映射做详细的分析。当然,在分析MFC消息映射之前首先对Windows程序的消息处理过程进行一个简单的描述。

Ocean2006的专栏 1万+

MFC之消息映射机制

上次简单的认识了一下MFC初始化过程。这次来认识一下MFC中的消息映射机制。 MFC对话框程序的消息处理(消息映射机制) 1.为一个对话框模板建立一个与之关联的CDialog或CDialogEx派生类 2.在需要启动对话框用派生类定义一个对象,在用对象调用DoModal成员函数 3.在消息列表中就可以选择你需要的消息,双击即可建立消息映射函数 4.在消息映射函数就是:一消息(和一

XGamer 1469

MFC的消息映射机制的理解

一、映射机制原理 Windows程序是基于消息机制来编程的。 MFC消息映射机制的具体实现方法是:在每个能接收和处理消息的类中,定义一个消息和消息函数静态对照表,即消息映射表。在消息映射表中,消息与对应的消息处理函数指针是成对出现的,也就是他们是绑定在一起的。某个类能处理的所有消息及其对应的消息处理函数的地址都列在这个类所对应的静态对照表中。当有消息需要处理时,程序只要搜索该消息静态表

MyDriverC 913

MFC程序设计(五)消息映射机制

在上一章的内容中,我们找到了真正的窗口消息处理函数AfxWndProc。通过AfxWndProc处理消息存在一个问题:当要自定义处理很多消息时,重写AfxWndProc就会变得很麻烦。我们在通过向导创建的MFC程序中,发现使用了消息映射机制,这种机制会方便我们实现很多消息处理,因此消息映射就变得很重要了。

2301_78838647的博客 748

孙鑫VC++第四章 1.简单绘图-MFC消息映射机制

MFC消息映射机制

qq_38446366的博客 1110
上一篇: Win32编写窗口程序的步骤
下一篇: MFC程序退出提示
丶CrazyPanda
博客等级 码龄17年 18粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值