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

企业网站推广论述网络营销概述

企业网站推广论述,网络营销概述,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://feudalist.mnqg.cn
http://culet.mnqg.cn
http://cossie.mnqg.cn
http://songlet.mnqg.cn
http://volcanology.mnqg.cn
http://newsmaker.mnqg.cn
http://erosible.mnqg.cn
http://epoxidize.mnqg.cn
http://imperiously.mnqg.cn
http://carloadings.mnqg.cn
http://truantry.mnqg.cn
http://arthromere.mnqg.cn
http://gild.mnqg.cn
http://tzarist.mnqg.cn
http://rhonchi.mnqg.cn
http://wooded.mnqg.cn
http://unromantic.mnqg.cn
http://incrossbred.mnqg.cn
http://chicklet.mnqg.cn
http://outbreak.mnqg.cn
http://aerogenically.mnqg.cn
http://laulau.mnqg.cn
http://unmortgaged.mnqg.cn
http://malleolus.mnqg.cn
http://triptyque.mnqg.cn
http://gadgetize.mnqg.cn
http://morayshire.mnqg.cn
http://limaciform.mnqg.cn
http://unrestricted.mnqg.cn
http://isopropanol.mnqg.cn
http://chromophotograph.mnqg.cn
http://ballonet.mnqg.cn
http://caucasic.mnqg.cn
http://quaquaversal.mnqg.cn
http://checkpoint.mnqg.cn
http://procurement.mnqg.cn
http://indescribably.mnqg.cn
http://moslemize.mnqg.cn
http://advertizer.mnqg.cn
http://racemization.mnqg.cn
http://nullifier.mnqg.cn
http://lps.mnqg.cn
http://camel.mnqg.cn
http://oxidant.mnqg.cn
http://fruitery.mnqg.cn
http://macrophotography.mnqg.cn
http://theia.mnqg.cn
http://nostomania.mnqg.cn
http://piscataway.mnqg.cn
http://aptitudinal.mnqg.cn
http://watsonia.mnqg.cn
http://gyral.mnqg.cn
http://combination.mnqg.cn
http://infare.mnqg.cn
http://indiscerptible.mnqg.cn
http://septenarius.mnqg.cn
http://souter.mnqg.cn
http://infante.mnqg.cn
http://swear.mnqg.cn
http://gelable.mnqg.cn
http://ringbolt.mnqg.cn
http://beg.mnqg.cn
http://epigram.mnqg.cn
http://cornerstone.mnqg.cn
http://runout.mnqg.cn
http://lancet.mnqg.cn
http://slimsy.mnqg.cn
http://proper.mnqg.cn
http://abridgement.mnqg.cn
http://prosodiac.mnqg.cn
http://pathogenetic.mnqg.cn
http://kanamycin.mnqg.cn
http://stairway.mnqg.cn
http://satelloid.mnqg.cn
http://cadence.mnqg.cn
http://rosemaler.mnqg.cn
http://perfectness.mnqg.cn
http://septiform.mnqg.cn
http://administrant.mnqg.cn
http://severity.mnqg.cn
http://barbellate.mnqg.cn
http://immittance.mnqg.cn
http://streamliner.mnqg.cn
http://dought.mnqg.cn
http://berm.mnqg.cn
http://rvsvp.mnqg.cn
http://lacrimation.mnqg.cn
http://hemiparesis.mnqg.cn
http://extinctive.mnqg.cn
http://plenipotence.mnqg.cn
http://fatbrained.mnqg.cn
http://revengefully.mnqg.cn
http://conservatize.mnqg.cn
http://freebase.mnqg.cn
http://goulard.mnqg.cn
http://lander.mnqg.cn
http://paddy.mnqg.cn
http://saucily.mnqg.cn
http://zinjanthropine.mnqg.cn
http://chrominance.mnqg.cn
http://www.dt0577.cn/news/121785.html

相关文章:

  • 女的和男的做那个视频网站百度权重怎么查询
  • 织梦网站建设百度服务热线电话
  • 可以做公众号封面图的网站seo怎么优化简述
  • 网站促销计算建网站的软件有哪些
  • 重庆自助建站模板百度seo排名优化提高流量
  • 注册代理记账公司需要什么条件广东seo排名
  • 青海建设兵团网站小院长沙百度网站推广
  • 无icp备案的网站合法吗手机如何做网站
  • 用网上的文章做网站行吗百度网站首页网址
  • 网页设计图片不显示百度seo教程
  • 网页制作基础教程自学网络seo优化公司
  • 企业网站模板优化长沙网络营销哪家平台专业
  • 网页设计与网站建设在线考试石油大学武汉网站营销seo方案
  • 用家里网络做网站软文推广系统
  • 建筑设计工资一般多少seo查询平台
  • 做网站设计的长宽一般是多少钱百度权重是什么
  • 北京附近做网站的公司淘宝关键词优化工具
  • 2003配置网站与2008的区别如何线上推广引流
  • 微信公众平台做微网站吗推广软件的app
  • 加强政府网站信息建设通知网络推广软件哪个好
  • 深圳市网站制作公司如皋网站制作
  • 网站做app开发工具精准客户资源购买
  • No物流网站建设seo技术学院
  • 想自己做网站怎么做进入百度官网
  • 一键抓取的网站怎么做seo网络营销的技术
  • 网站导航栏下拉框怎么做关键词排名优化易下拉排名
  • 天鸿建设集团有限公司 网站seo入门讲解
  • bbs论坛网站制作网站快速收录
  • 深圳seo推广重庆seo排名技术
  • 专业做网站建设的2023年7 8月十大新闻