在用 m_sp1.CreateView(0,0,RUNTIME_CLASS(CView1),CSize(100,100),pContext);创建分割窗体的程序时,可以用该语句创建一个View来填充分割区,谁能详细讲一下RUNTIME_CLASS()的作用是干什么的??
MSDN上好象讲的不是很清楚的.

解决方案 »

  1.   

    建议你看一下《MFC深入浅出》第三章RTTI,就全明白了:)
      

  2.   

    #define RUNTIME_CLASS(class_name) \
    (&class_name::class##class_name)
      

  3.   

    出现在巨集定义的##,表示将两个字串合并在一起,例如:
    RUNTIME_CLASS(CView1)
    则表示(&CView1::classCView1)其中classCView1是每个类都有的一个成员变量,他是属于一个CRuntimeClass类,这个类中包含有很多字段,包含了这个类的名称,类的大小等信息。
      

  4.   

    Just as its name.it interprets the parameter which class will be used when it at run time.