ATL_NO_VTBL是作什么的?解决办法
ATL_NO_VTBL是作什么的?
ATL_NO_VTBL是作什么的?
------解决方案--------------------
可能会替换成 __declspec(novtable) 或者什么都没有
这是解释
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.
If you attempt to instantiate a class marked with novtable and then access a class member, you will receive an access violation (AV).
------解决方案--------------------
在一有虚函数的类里,用ATL_NO_VTBL后,编译器在派生类的构造过程中不为基类产生虚表(vtable)。
ATL_NO_VTBL是作什么的?
------解决方案--------------------
可能会替换成 __declspec(novtable) 或者什么都没有
这是解释
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.
If you attempt to instantiate a class marked with novtable and then access a class member, you will receive an access violation (AV).
------解决方案--------------------
在一有虚函数的类里,用ATL_NO_VTBL后,编译器在派生类的构造过程中不为基类产生虚表(vtable)。