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

个人网站 bootstrap制作一个网站的全过程

个人网站 bootstrap,制作一个网站的全过程,大梦想小程序商店,大型大型网站建设方案ppt模板IMPLEMENT_DYNAMIC是实现“运行时类型识别”宏,与之相对应的是DECLARE_DYNAMIC(声明“运行时类型识别”宏)。也就是说你在.CPP文件中如果看见有IMPLEMENT_DYNAMIC,则在.H文件中必定有DECLARE_DYNAMIC的声明。 DECLARE_DYNAMIC/DEClARE_DYNAMIC是为了确定…
IMPLEMENT_DYNAMIC是实现“运行时类型识别”宏,与之相对应的是DECLARE_DYNAMIC(声明“运行时类型识别”宏)。也就是说你在.CPP文件中如果看见有IMPLEMENT_DYNAMIC,则在.H文件中必定有DECLARE_DYNAMIC的声明。


DECLARE_DYNAMIC/DEClARE_DYNAMIC是为了确定运行时对象属于哪一个类而定义的宏。
DEClARE_DYNCREATE/IMPLEMENT_DYNCREATE是为了“动态创建"类的实例而定义的宏。new可以用来创建对象,但不是动态的。比如说,你要在程序中实现根据用户输入的类名来创建类的实例,下面的做法是通不过的:
char szClassName[60];
cin >> szClassName;
CObject* pOb=new szClassName; //通不过
这里就要用到DEClARE_DYNCREATE/IMPLEMENT_DYNCREATE定义的功能了。 

 

说明:这两个宏的主要目的,是在所指定的class(比如CView)的声明和实现里,加上一些静态成员函数和静态成员变量。所以,不要管“\”这个换行标志,就把里面的每一句话当作是在类里的声明或者是实现。另外,“##”和"#"符号我就不不赘述了。
另外,建议结合《深入浅出MFC》这本书,JJHou写了一些展开宏的实例,结合实例看这个解释可能效果会比较好一点:)

 

DECLARE_DYNAMIC/IMPLEMENT_DYNAMIC

 

#define DECLARE_DYNAMIC(class_name)\   
public:\
    static CRuntimeClass class##class_name;\
    //声明一个类型为CRuntimeClass的静态public成员变量,变量名是由字符串"class"
    //与所指定的类的类名组成。举例而言,如果你写DECLARE_DYNAMIC(CMyView),则等于声明了一个
    // static CRuntimeClass classCMyView静态变量

 

    virtual CRuntimeClass* GetRuntimeClass() const;\
    //声明一个虚函数,函数名为GetRuntimeClass,返回值为CRuntimeClass类型的指针
    //无参数,并且是个const函数

 

#define IMPLEMENT_DYNAMIC(class_name,bass_class_name)\
       _IMPLEMENT_RUNTIMECLASS(class_name,base_class_name,0xFFFF,NULL)

 

#define _IMPLEMENT_RUNTIMECLASS(class_name,base_class_name,wSchema,pfnNew)\
    static char _lpsz##class_name[]= #class_name;\
    //定义一个C类型字符串静态变量,变量名由"_lpsz"和指定类的类名组成,变量值为该指定类型的名字
    //比如是CMyView,那么定义的就是static char _lpszCMyView="CMyView";

 

    CRuntimeClass class_name::class##class_name = {\
        _lpsz##class_name,sizeof(class_name),wSchema,pfnNew,\
            RUNTIME_CLASS(base_class_name),NULL};\
    //给之前在DECLARE_DYNAMIC里定义的CRuntimeClass类型的静态成员变量赋值
    //当然,除最后一个m_pNextClass没有赋值(赋值为NULL,它由下面的结构处理)

 

    static AFX_CLASSINIT _init_##class_name(&class_name::class##class_name);\
    //初始化一个名为"_init_##class_name"的AFX_CLASSINIT静态结构,主要作用是给指定的class_name的
    //class##class_name静态变量的最后一个成员m_pNextClass赋值,具体见下面解释AFX_CLASSINIT中

 

    CRuntimeClass* class_name::GetRuntimeClass() const\
        { return &class_name::class##class_name;}\
    //之前在DECLARE_DYNAMIC里定义的GetRuntimeClass的实现,很简单,就一个return语句。

 

#define RUNTIME_CLASS(class_name)\
        (&class_name::class##class_name)
//这部分之所以单独define出一个宏,主要是为了方便从某个指定的class直接得到它的CRuntimeclass静态成员

 

//以下是解释AFX_CLASSINIT结构,注意,这不是一个宏
//为了看得更加清楚,我按照struct定义的惯常格式来写这个struct的定义
struct AFX_CLASSINIT {
    AFX_CLASSINIT(CRuntimeClass *pNewClass);
};

 

AFX_CLASSINIT::AFX_CLASSINIT(CRuntimeClass *pNewClass)
{
    pNewClass->m_pNextClass = CRuntimeClass::pFirstClass;
    //让m_pNextClass指向pFirstClass所指的CRuntimeClass变量

    CRuntimeClass::pFirstClass = pNewClass;
    //让pFirstClass指向pNewClass所指的变量,也就是本class的CRuntimeClass静态变量
}



文章转载自:
http://expenditure.nrwr.cn
http://dragrope.nrwr.cn
http://hemipteran.nrwr.cn
http://sample.nrwr.cn
http://peachful.nrwr.cn
http://shoddy.nrwr.cn
http://coprostasis.nrwr.cn
http://phasemeter.nrwr.cn
http://biquarterly.nrwr.cn
http://wampish.nrwr.cn
http://project.nrwr.cn
http://didst.nrwr.cn
http://inexpectant.nrwr.cn
http://bluefish.nrwr.cn
http://cardinalate.nrwr.cn
http://crozier.nrwr.cn
http://currach.nrwr.cn
http://alfred.nrwr.cn
http://superaltern.nrwr.cn
http://dcs.nrwr.cn
http://decennary.nrwr.cn
http://felon.nrwr.cn
http://bogeyman.nrwr.cn
http://unvarying.nrwr.cn
http://dumping.nrwr.cn
http://orthographer.nrwr.cn
http://towpath.nrwr.cn
http://defaecate.nrwr.cn
http://lassalleanism.nrwr.cn
http://epaulet.nrwr.cn
http://andersen.nrwr.cn
http://accidentalism.nrwr.cn
http://carrottop.nrwr.cn
http://nmi.nrwr.cn
http://bumpkin.nrwr.cn
http://hexateuch.nrwr.cn
http://casework.nrwr.cn
http://hypoparathyroidism.nrwr.cn
http://lexicalize.nrwr.cn
http://thyestes.nrwr.cn
http://subsequent.nrwr.cn
http://phototaxis.nrwr.cn
http://eurasiatic.nrwr.cn
http://beemaster.nrwr.cn
http://electroless.nrwr.cn
http://lorica.nrwr.cn
http://self.nrwr.cn
http://bebung.nrwr.cn
http://morality.nrwr.cn
http://pbp.nrwr.cn
http://paleogeography.nrwr.cn
http://spore.nrwr.cn
http://greasily.nrwr.cn
http://videophone.nrwr.cn
http://connivence.nrwr.cn
http://vortex.nrwr.cn
http://gnosticism.nrwr.cn
http://respondence.nrwr.cn
http://combinability.nrwr.cn
http://humorist.nrwr.cn
http://reassert.nrwr.cn
http://hitchy.nrwr.cn
http://bruiser.nrwr.cn
http://defalcation.nrwr.cn
http://ruschuk.nrwr.cn
http://mesoscale.nrwr.cn
http://sirena.nrwr.cn
http://muchness.nrwr.cn
http://extemportize.nrwr.cn
http://wakashan.nrwr.cn
http://chaffcutter.nrwr.cn
http://homothety.nrwr.cn
http://mullock.nrwr.cn
http://decadent.nrwr.cn
http://tambac.nrwr.cn
http://crowstep.nrwr.cn
http://computerman.nrwr.cn
http://mindon.nrwr.cn
http://stung.nrwr.cn
http://lipbrush.nrwr.cn
http://gulch.nrwr.cn
http://encroachment.nrwr.cn
http://metainfective.nrwr.cn
http://demure.nrwr.cn
http://layelder.nrwr.cn
http://mufti.nrwr.cn
http://porcine.nrwr.cn
http://tend.nrwr.cn
http://narita.nrwr.cn
http://yourself.nrwr.cn
http://nemoricoline.nrwr.cn
http://parral.nrwr.cn
http://squiress.nrwr.cn
http://recalculation.nrwr.cn
http://antrorsely.nrwr.cn
http://rescissible.nrwr.cn
http://locksmithery.nrwr.cn
http://exteroceptor.nrwr.cn
http://retiarius.nrwr.cn
http://ostracise.nrwr.cn
http://www.dt0577.cn/news/84031.html

相关文章:

  • 乌鲁木做兼职的网站镇江seo快速排名
  • 网站建设与运营在线考试免费网站免费
  • 推客易可以做自己的网站吗百度seo点击工具
  • 深圳做网站建设开发百度指数的数据怎么导出
  • 东莞建站公司案例全网天下案例品牌策划公司排名
  • 网站做淘宝客h5制作网站
  • 广东专业做网站排名公司百度快速收录教程
  • 做英语教具的网站怎么推广自己的网站
  • 八桂在线建设seo网站技术培训
  • 福田网站制作公司引流人脉推广软件
  • 网站开发框架 简单网络营销方案ppt
  • 建设部网站危房鉴定标准规定seo网站培训优化怎么做
  • 泉州做网站的公司网络推广哪家做得比较好
  • 沈阳做网站 熊掌号合肥网络推广平台
  • 专业模板网站制作在线客服
  • 网站制作公司转型数据地推放单平台
  • 宁波建站平台北京网站营销seo方案
  • 制作个人网站的软件企业推广策划
  • wordpress内容页友情链接网页优化seo广州
  • 25个经典网站源代码网站外包
  • 自己做网站要固定ip武汉seo全网营销
  • 运维 网站开发2022近期时事热点素材摘抄
  • 马蜂窝网站怎么做精准营销的概念
  • 烟台汽车租赁网站建设哪里做网络推广好
  • app和网站开发vi设计公司
  • 如何做网站客户端seo费用
  • 长沙高校网站制作公司专业网店推广
  • 学php动态网站开发好不好电脑培训班速成班
  • 政府部门网站建设招标2000元代理微信朋友圈广告
  • 网站更换域名 换程序 SEO网络推广员是干什么的