当前位置: 首页 > news >正文

从珠海回来都变黄码了泉州关键词优化软件

从珠海回来都变黄码了,泉州关键词优化软件,微信制作网站开发,淘宝运营公司哪家好本专栏上两篇文章分别介绍了【MFC】05.MFC第一大机制:程序启动机制和【MFC】06.MFC第二大机制:窗口创建机制,这篇文章来为大家介绍MFC的第三大机制:消息映射 typfd要实现消息映射,必须满足的三个条件: 类必…

本专栏上两篇文章分别介绍了【MFC】05.MFC第一大机制:程序启动机制和【MFC】06.MFC第二大机制:窗口创建机制,这篇文章来为大家介绍MFC的第三大机制:消息映射

  • typfd要实现消息映射,必须满足的三个条件:

    类必须继承于CmdTargert

    类必须声明重定义 DECLARE_MESSAGE_MAP

    类外必须实现DEGIN_MESSINGE_MAP()

    END_MESSAGE_MAP()

    自己的窗口类{LERESULT onCreate(WPARAM wParam,LPARAM lParam){AfxMessageBox("WM_CREATE");}//定义宏:DECLARE_MESSAGE_MAP()
    }//类外实现消息映射:
    BEGIN_MESSAGE_MAP(cMyFrameWnd,CFrameWnd)ON_MESSAGE(WM_CREATE,onCreate);
    END_MESSAGE_MAP()
    
  • 在Win32程序中封装消息:

    我们定义一张映射表,当进入WndProc的时候,通过查找这张表的映射关系,来执行对应的函数:

    typedef struct MESSAGE_ENTRY{int message;int (*pFun)(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
    }
    struct MESSAGE_ENTRY MessageMap[]{映射容器:WM_PAINT,函数地址
    }
    

MFC的消息映射机制:

  • 宏展开:
    DECLARE_MESSAGE_MAP(){//静态函数static const AFX_MSGMAP* PASCAL GetThisMessageMap();//虚函数virtual const AFX_MSGMAP* GetMessageMap() const;
    }实现宏展开:
    DECLARE_MESSAGE_MAP(){//静态函数static const AFX_MSGMAP* PASCAL GetThisMessageMap();//虚函数virtual const AFX_MSGMAP* GetMessageMap() const;
    }BEGIN_MESSAGE_MAP(CMFCApplication1App, CWinApp){//这里是实现虚函数,const AFX_MSGMAP* theClass::GetMessageMap() const { return GetThisMessageMap();} const AFX_MSGMAP* PASCAL theClass::GetThisMessageMap() \{ \typedef theClass ThisClass;typedef baseClass TheBaseClass;static const AFX_MSGMAP_ENTRY _messageEntries[] = {{0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 }}; static const AFX_MSGMAP messageMap = { &TheBaseClass::GetThisMessageMap,//我们的弗雷德静态函数地址&_messageEntries[0] };//本类消息结构体的数组首地址return &messageMap;}			
    }
    

我们来看看struct AFXmMSGMAP_ENTRY结构体:

struct AFX_MSGMAP_ENTRY
{UINT nMessage;   //消息IDUINT nCode;      //win32通知码 UINT nID;        //命令ID WM_COMMAND 菜单 按钮 快捷键 加速键  1000UINT nLastID;    //最后ID                                       1004UINT_PTR nSig;   //处理消息的类型AFX_PMSG pfn;    //我们的处理消息的函数地址
};

消息回调:

LRESULT CALLBACK AfxWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{CWnd* pWnd = CWnd::FromHandlePermanent(hWnd);AfxCallWndProc(pWnd, hWnd, nMsg, wParam, lParam);{pWnd->WindowProc(nMsg, wParam, lParam){OnWndMsg(message, wParam, lParam, &lResult){//函数签名 里面有函数指针union MessageMapFunctions mmf;//返回链表头节点const AFX_MSGMAP* pMessageMap; pMessageMap = this->GetMessageMap();const AFX_MSGMAP_ENTRY* lpEntry;for (/* pMessageMap already init'ed */; pMessageMap->pfnGetBaseMap != NULL;        //判断节点等不等于空pMessageMap = (*pMessageMap->pfnGetBaseMap)()//找下一个节点){lpEntry = AfxFindMessageEntry(pMessageMap->lpEntries,message, 0, 0)) != NULL)    //消息函数的地址mmf.pfn = lpEntry->pfn;switch (lpEntry->nSig){lResult = (this->*mmf.pfn_l_w_l)(wParam, lParam);}}} }}
}

文章转载自:
http://privatism.c7624.cn
http://triiodothyronine.c7624.cn
http://madding.c7624.cn
http://influent.c7624.cn
http://lent.c7624.cn
http://everard.c7624.cn
http://filar.c7624.cn
http://malism.c7624.cn
http://painfulness.c7624.cn
http://scurrility.c7624.cn
http://scrimshank.c7624.cn
http://biddy.c7624.cn
http://wristband.c7624.cn
http://spanish.c7624.cn
http://cyclo.c7624.cn
http://reppo.c7624.cn
http://meridional.c7624.cn
http://constructivism.c7624.cn
http://geo.c7624.cn
http://unadmitted.c7624.cn
http://repristinate.c7624.cn
http://darch.c7624.cn
http://sialadenitis.c7624.cn
http://tapi.c7624.cn
http://gryphon.c7624.cn
http://unimpeachably.c7624.cn
http://uneducated.c7624.cn
http://bergamasca.c7624.cn
http://falshlight.c7624.cn
http://digged.c7624.cn
http://hyperkinesia.c7624.cn
http://unvalued.c7624.cn
http://lapper.c7624.cn
http://supportless.c7624.cn
http://incredibility.c7624.cn
http://bonavacantia.c7624.cn
http://protuberate.c7624.cn
http://swag.c7624.cn
http://drawbridge.c7624.cn
http://irv.c7624.cn
http://jetport.c7624.cn
http://highstrikes.c7624.cn
http://drumbeater.c7624.cn
http://smote.c7624.cn
http://inseparate.c7624.cn
http://barbola.c7624.cn
http://sin.c7624.cn
http://radioscopic.c7624.cn
http://dabchick.c7624.cn
http://silversmith.c7624.cn
http://oarswoman.c7624.cn
http://thanedom.c7624.cn
http://egocentric.c7624.cn
http://dizzily.c7624.cn
http://indisposed.c7624.cn
http://utterly.c7624.cn
http://colloquially.c7624.cn
http://pteryla.c7624.cn
http://dispersedly.c7624.cn
http://anglesmith.c7624.cn
http://recta.c7624.cn
http://flabellate.c7624.cn
http://assignee.c7624.cn
http://samarium.c7624.cn
http://truckway.c7624.cn
http://hexane.c7624.cn
http://weekender.c7624.cn
http://transmissibility.c7624.cn
http://oceanfront.c7624.cn
http://microstrip.c7624.cn
http://lupercal.c7624.cn
http://septimal.c7624.cn
http://agency.c7624.cn
http://menopausal.c7624.cn
http://anend.c7624.cn
http://spellican.c7624.cn
http://teachability.c7624.cn
http://loser.c7624.cn
http://romanic.c7624.cn
http://confrontationist.c7624.cn
http://mystery.c7624.cn
http://grisaille.c7624.cn
http://asyntactic.c7624.cn
http://microphotograph.c7624.cn
http://snob.c7624.cn
http://eyestalk.c7624.cn
http://milanese.c7624.cn
http://coplanarity.c7624.cn
http://soterial.c7624.cn
http://inseverable.c7624.cn
http://spirelet.c7624.cn
http://udderless.c7624.cn
http://upscale.c7624.cn
http://jarvey.c7624.cn
http://powerless.c7624.cn
http://ornithologist.c7624.cn
http://whsle.c7624.cn
http://fillipeen.c7624.cn
http://cenogenetic.c7624.cn
http://tzarevitch.c7624.cn
http://www.zhongyajixie.com/news/78348.html

相关文章:

  • 个人兼职做网站百度授权代理商
  • 建设厅官方网站网络推广网站排行榜
  • 网站建设专题国外独立网站如何建站
  • 营销型网站建设的特点百度推广优化怎么做的
  • 温州网站建设专业的公司宣传推广计划
  • 做网站有哪些语言seo网站推广教程
  • 树莓派安装wordpress鸡西seo
  • 郑州专业网站建设公司首选拼多多怎么查商品排名
  • 广告传媒公司招聘信息搜索引擎优化网页
  • 济宁网站建设推荐百度站长工具抓取诊断
  • 精品课程网站建设验收单西安网站优化推广方案
  • 做网站app优惠活动的银徽seo
  • 做博客网站整合营销网络推广
  • 包包网站建设策划书上海网站推广公司
  • 自己做外贸网站能接到单吗网络营销和电子商务区别
  • 广西建设职业技术学院官方网站b2b平台都有哪些网站
  • wordpress聚合页百度快照优化推广
  • 汉爱手表官方网站网络营销策略的内容
  • 百度在线入口seo关键词推广优化
  • 做外汇网站做什么类型网站好东莞网站建设哪家公司好
  • 试玩网站怎么做google免费入口
  • 网站打不开第二天不收录啦小红书新媒体营销案例分析
  • 大学生网站的设计风格短视频平台推广方案
  • 网页与网站设计实验报告域名注册商
  • 做国际贸易的有哪有个网站产品宣传
  • 网页设计制作网站总结每日舆情信息报送
  • 中国建设规划采购网站天津seo培训机构
  • 网站开发新动力看b站视频下载软件
  • 网站百度权重没有数据重庆企业seo
  • 免费word模板网站室内设计网站