Subj : Re: Typecasting question To : borland.public.cpp.borlandcpp From : Greg Chicares Date : Wed Dec 15 2004 10:31 am On 2004-12-15 2:59 AM, wmd wrote: > > "Greg Chicares" wrote in message > news:41bf9bf0$1@newsgroups.borland.com... > [OP wants to invoke a function in one class on an object of another, using a pointer to member function] > >> declare [the function] in a base class, and use >> it for classes that derive from that base. > > use mfc > > class X: public CObject { > ............. > }; Most classes in the mfc framework are derived from a common base class, CObject. But if that class doesn't declare the function that the OP wants to use, for instance because he wrote it himself, then I don't think it can help him here. The idea of deriving everything from a common base class is generally considered poor design in C++, BTW. Really old libraries may have used that architecture, for instance, as a way of implementing containers without using templates. But over the years we've learned that C++ favors a forest instead of a tree topology. .