From: Weiqi G. <wei...@ne...> - 2002-11-16 03:48:50
|
Oscar Fuentes wrote: > > Weiqi Gao wrote: > > > > And all compilers do the pointer manipulation the same way, > > Have you checked this? No. I was rephrasing Charles Kindel, who said: > > The core of COM is the specification of the binary, in-memory layout, of an > interface vtable. The layout COM uses just happens to be the same layout > that all popular C++ compilers use for their C++ vtable layouts. In C, you > just build one of these vtables yourself by allocating a chunk of memory > and filling it in with function pointers. I should have qualified the compilers to "all popular C++ compilers on Windows in 1996". > My experience shows evidency that > supports the opposite claim. The virtual call mechanism is > implementor-defined and each vendor seems to have its own > ideas about how to implement it. And when dealing with such compilers the trick which is the topic of this thread won't work. -- Weiqi Gao wei...@ne... |