Quote:
Originally posted by corcor
Yeah, I also can put it in a "not - CWnd derived class" and derive my views from this class and the old base class, like
class CMyViewBase
{
void DoEditCopy();
}
class CMySpezialView1 : public CScrollView, public CMyViewBase
{
afx_msg void OnEditCopy();
}
void CMySpezialView1::OnEditCopy()
{
DoEditCopy();
}
but then, I need for EACH view and EACH command
*) ON_COMMAND(...)
*) ON_UPDATE_COMMAND_UI(...)
*) OnEditCopy
*) OnUpdateEditCopy
:(
Every time I add a new command, I have to go through all views to attach the command / update-command handlers and maybe forget on view....
So my goal is to modify one class and automatically have it in all views.
If the implementation for each method will be the same or very close, why not use a shim class to avoid all the rewriting?