class AFX_NOVTABLE CCmdTarget : public CObject 中AFX_NOVTABLE 是什么意思~?

解决方案 »

  1.   

    novtable
    Microsoft and C++ SpecificThis is a __declspec extended attribute. This form of _declspec can be applied to any class declaration, but should only be applied to pure interface classes, that is classes that will never be instantiated on their own. The _declspec stops the compiler from generating code to initialize the vfptr in the constructor(s) and destructor of the class. In many cases, this removes the only references to the vtable that are associated with the class and, thus, the linker will remove it. Using this form of _declspec can result in a significant reduction in code size.
      

  2.   

    // This macro is used to reduce size requirements of some classes
    #ifndef AFX_ALWAYS_VTABLE
    #ifndef AFX_NOVTABLE
    #if _MSC_VER >= 1100 && !defined(_DEBUG)
    #define AFX_NOVTABLE __declspec(novtable)
    #else
    #define AFX_NOVTABLE
    #endif
    #endif
    #endif
      

  3.   

    AFX_NOVTABLE是个宏定义:__declspec(novtable):novtable
    Microsoft and C++ Specific —>This is a __declspec extended attribute. This form of _declspec can be applied to any class declaration, but should only be applied to pure interface classes, that is classes that will never be instantiated on their own. The _declspec stops the compiler from generating code to initialize the vfptr in the constructor(s) and destructor of the class. In many cases, this removes the only references to the vtable that are associated with the class and, thus, the linker will remove it. Using this form of _declspec can result in a significant reduction in code size.
      

  4.   

    AFX_NOVTABLE是个宏定义:__declspec(novtable):novtable
    Microsoft and C++ Specific —>This is a __declspec extended attribute. This form of _declspec can be applied to any class declaration, but should only be applied to pure interface classes, that is classes that will never be instantiated on their own. The _declspec stops the compiler from generating code to initialize the vfptr in the constructor(s) and destructor of the class. In many cases, this removes the only references to the vtable that are associated with the class and, thus, the linker will remove it. Using this form of _declspec can result in a significant reduction in code size.
      

  5.   

    AFX_NOVTABLE是个宏定义:__declspec(novtable):novtable
    Microsoft and C++ Specific —>This is a __declspec extended attribute. This form of _declspec can be applied to any class declaration, but should only be applied to pure interface classes, that is classes that will never be instantiated on their own. The _declspec stops the compiler from generating code to initialize the vfptr in the constructor(s) and destructor of the class. In many cases, this removes the only references to the vtable that are associated with the class and, thus, the linker will remove it. Using this form of _declspec can result in a significant reduction in code size.
      

  6.   

    怎么和msdn一样,都是抄的 !!
      

  7.   

    让编译器延迟建立vtable,,在实例化的时候再建立,就是在派生链的末端之前不需要vtable
      

  8.   

    我要是没看MSDN ,我就不来了~~
    其实。我是想看看大家对英文的理解~~
    每个人的理解都不同的~~
    你们却都给我英文的原版~~
    呵呵谢谢了~~
    不过,分么,就要少给各位了~~
      

  9.   

    让编译器延迟建立vtable,,在实例化的时候再建立,就是在派生链的末端之前不需要vtable
      

  10.   

    噢~~~~~~~~upupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupupup
      

  11.   

    用来禁止构造期间对vptr的调整,使用atl_no_vtbl的类不能在构造函数中调用虚成员函数。