At 10:28 AM -0700 6/23/05, Steve Checkoway wrote: The virtual destructor has to be in the vtable somewhere. COM expects a specific vtable layout, with the methods in a predictable order and without extra vtable slots between an interface's methods and those of a derived interface. Adding a virtual destructor inserts such a slot, and furthermore does it in a compiler-specific place, so in COM it is verboten. How can it expect a particular vtable layout? It seems to me that that could change with a different compiler version. Also, depending on the vtable layout seems like a bad idea but I guess for binary compatibility, there isn't much one can do.
The virtual destructor has to be in the vtable somewhere. COM expects a specific vtable layout, with the methods in a predictable order and without extra vtable slots between an interface's methods and those of a derived interface. Adding a virtual destructor inserts such a slot, and furthermore does it in a compiler-specific place, so in COM it is verboten.