How about using a template?
Something similar to the mem_fun() adapter.
// Totally untested code follows
template <class T>
MemFunCommand : public Command
{
T* mpHost;
void (T::* mpMemFun)();
public:
explicit
MemFunCommand(T* pHost, void (T::* pMemFun)())
: mpHost(pHost), mpMemFun(pMemFun)
{
}
void Execute()
{
mpHost->*mpMemFun();
}
};
Then you can do something like:
CDPlayer cdp;
Button PlayButton(MemFunCommand<CDPlayer>(&cdp, &CDPlayer::Play));
Button StopButton(MemFunCommand<CDPlayer>(&cdp, &CDPlayer::Stop));
etc.