"Eric W. Sirko" <[EMAIL PROTECTED]> wrote in message
news:53089@palm-dev-forum...
>
> Hi,
>
> I understand why I can't use virtual functions in a shared library --
> there's no place for the compiler to put the vtable.  What about
virtual
> base classes?  I am trying to use a virtual base class in a shared
library,
> but whenever I call into the virtual base and it tries to access one
of its
> data members, I get a run-time "address error," meaning that
(according to
> the error popup) my code accessed a 2-byte value at an odd memory
address.
>
> I am using CW6.  Does anyone understand what is going on?  I am
wondering
> whether this is a shared library anomaly or because CW does not
implement
> virtual bases properly in the first place...

Virtual base classes require vtables to implement.  When you declare a
base class as virtual, a vtable entry is allocated for any derived
classes to point to where the virtual base is located in the object's
data structure.  Without that, you can't implement the nice property
where there is only one copy of the virtual base's members.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to