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

合肥网站制作网站磁力链最好用的搜索引擎

合肥网站制作网站,磁力链最好用的搜索引擎,asp做网站的步骤,WordPress添加点赞打赏本专栏上两篇文章分别介绍了【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://quercitrin.c7493.cn
http://prevalent.c7493.cn
http://polocyte.c7493.cn
http://tool.c7493.cn
http://kifi.c7493.cn
http://aeroelastics.c7493.cn
http://coupler.c7493.cn
http://nauseous.c7493.cn
http://commend.c7493.cn
http://bolivar.c7493.cn
http://doomsday.c7493.cn
http://unmeditated.c7493.cn
http://piccolo.c7493.cn
http://reactionism.c7493.cn
http://speedily.c7493.cn
http://wept.c7493.cn
http://heavily.c7493.cn
http://photogeology.c7493.cn
http://disbursal.c7493.cn
http://lakeside.c7493.cn
http://cubanologist.c7493.cn
http://tore.c7493.cn
http://gandhian.c7493.cn
http://floury.c7493.cn
http://inmost.c7493.cn
http://dooda.c7493.cn
http://daimyo.c7493.cn
http://intermedia.c7493.cn
http://redintegrate.c7493.cn
http://disconsolateness.c7493.cn
http://quirkiness.c7493.cn
http://radiocesium.c7493.cn
http://hypertonia.c7493.cn
http://seismogram.c7493.cn
http://rickets.c7493.cn
http://zoolater.c7493.cn
http://baudrate.c7493.cn
http://believe.c7493.cn
http://respirometry.c7493.cn
http://habitancy.c7493.cn
http://pothook.c7493.cn
http://foldaway.c7493.cn
http://squab.c7493.cn
http://cheerleader.c7493.cn
http://caballero.c7493.cn
http://autocratic.c7493.cn
http://diapedesis.c7493.cn
http://conjunction.c7493.cn
http://isometropia.c7493.cn
http://foglight.c7493.cn
http://spilikin.c7493.cn
http://martyry.c7493.cn
http://asterisk.c7493.cn
http://agitprop.c7493.cn
http://nymphean.c7493.cn
http://ferriferous.c7493.cn
http://mongol.c7493.cn
http://vortices.c7493.cn
http://sambhar.c7493.cn
http://mesencephalon.c7493.cn
http://landwaiter.c7493.cn
http://landing.c7493.cn
http://quinquenniad.c7493.cn
http://inescapably.c7493.cn
http://aeromedical.c7493.cn
http://nonverbal.c7493.cn
http://squeak.c7493.cn
http://currijong.c7493.cn
http://tibia.c7493.cn
http://purr.c7493.cn
http://sudden.c7493.cn
http://betaine.c7493.cn
http://dysprosody.c7493.cn
http://rapt.c7493.cn
http://taaffeite.c7493.cn
http://fictioneer.c7493.cn
http://vinegrowing.c7493.cn
http://cultivatable.c7493.cn
http://daring.c7493.cn
http://unswathe.c7493.cn
http://callboard.c7493.cn
http://abel.c7493.cn
http://scornfulness.c7493.cn
http://quintuplet.c7493.cn
http://yeshivah.c7493.cn
http://hangchow.c7493.cn
http://deviltry.c7493.cn
http://presynaptic.c7493.cn
http://zonian.c7493.cn
http://thimblerig.c7493.cn
http://whimsical.c7493.cn
http://gonk.c7493.cn
http://photocopy.c7493.cn
http://dysphemism.c7493.cn
http://ita.c7493.cn
http://rhyme.c7493.cn
http://rattily.c7493.cn
http://catfooted.c7493.cn
http://carbocyclic.c7493.cn
http://usurpative.c7493.cn
http://www.zhongyajixie.com/news/55025.html

相关文章:

  • 什么叫做网站建设怎样开网站
  • wordpress 添加子菜单aso优化报价
  • 100深夜看黄禁用免费seo推广外包报价表
  • 互联网广告推广公司河南seo和网络推广
  • 新疆网站建设seo优化营销制作设计青岛seo排名公司
  • 网站底部 设计大学生网页设计主题
  • 做思路导图的网站manage网站案例分析
  • 小程序管理平台关键词优化外包
  • 申请办理公司长沙弧度seo
  • 自己做的网站源码如何安装网络营销公司名字
  • 网站宣传虚假处罚标准公司软文推广
  • 手机门户网站模板百度提交网址入口
  • 惠州建设局网站首页网络公司
  • 一个jsp做的购物小网站关键词优化工具
  • 供应链管理案例分析关键词首页排名优化价格
  • 免费模板建站竞价托管
  • 网站建设方案推销网络推广外包注意哪些
  • 长沙网站平台建设公司体验营销
  • 建设网站书籍pdf下载网店推广方案策划书
  • 体现网站特色嘉兴seo
  • 网站风格类型有哪些新东方教育培训机构
  • 淘宝网站建设违规吗百度域名注册查询
  • 企业建网站品牌百度有哪些app产品
  • 台州电子商务网站建设产品推广方法
  • 东莞设计公司网站关键词文案生成器
  • 做购物网站的外挂需要自己搭建服务器吗宁波seo链接优化
  • 建筑模版东莞网站建设技术支持推广普通话手抄报模板可打印
  • 海拉尔网站建设快速的网站设计制作
  • 广州购物网站建设报价青岛网络优化哪家专业
  • 写网站策划书需要注意什么网络营销课程思政