From: Vince Morgan on
"Ulrich Eckhardt" <doomster(a)> wrote in message

> > Although most calls are objects of the base type, there are others of
> > derived type.
> > So as you can see above I have cast the base type objects to the derived
> > type in the callback. (correct cast?).
> > This is working fine, but I have come to realize I hadn't planned for
> > this, and that there may be a more appropriate method that deals with
> > possible future changes such as additional parent classes.
> This should be almost fine. You don't tell us about it, but On_Callback()
> is probably a virtual function defined in the baseclass. So, there is no
> need to cast to HoverTextButton, casting to the baseclass HoverButton
> should be enough, while the virtual dispatch does the rest.

I've slightly restructured the classes to use virtual dispatch, and it's
working fine.
Thank you again Uli

> Uli
> --
> FAQ: