Draw is very different for an artist than it is
for a cowboy, wed like to be able to provide two Draw implementations. For that, we a technique
long known to the C++ community that Ill call“forwarding
shims.”

The problem is that C++ has no syntax to be able to distinguish methods with
the same signature from different bases in the derived class. For example, the
following is not legal C++:

class CAcePowell :
public CComObjectRootEx<CComSingleThreadModel>,
public ICowboy,
public IArtist {

_IArtist
and _ICowboy
are shim classes that implement the method with the conflicting name and
forward to another pure virtual member function with a unique name.
Since both shims derive from the interface in question, they interfaces IArtist
and ICowboy
can still appear in the interface map without difficulty:

class CAcePowell :
public CComObjectRootEx<CComSingleThreadModel>,
public _ICowboy,
public _IArtist {

IArtist and ICowboy with _IArtist::Draw and _ICowboy::Draw.
These functions, in turn, forward to the more derived classs
implementation of the ArtistDraw and CowboyDraw. The forwarding shims remove our name
conflict at the cost of an extra vtable per shim class, an extra entry per
method per vtable and an extra virtual function invocation per call. If this
extra cost bothers you, remove it using the standard ATL tricks: