1. Yes you are right for most simple macro like DECLARE_MY_FUNC, but what about this?
#define COMPLICATED_ROUTINE(_wnd, _type, _oldvalue, _newvalue, _funget, _funset, _prop) \ _type _oldvalue = _wnd._funget();\ if ( _wnd._funset(_newvalue) )\ {\ _wnd.ShowResult( m_node##_prop );\ }
#define IMPLEMENT_MY_FUNC(_func, _type) \ _type _func()\ {\ MyWnd& _wnd = GetMyWnd();\ COMPLICATED_ROUTINE(_wnd, _type, nOldCount, nNewCount, GetCount, SetCount, Count)\ return nOldCount;
}
IMPLEMENT_MY_FUNC(Foobar, int)
And since the macro IMPLEMENT_MY_FUNC is nested by another macro COMPLICATED_ROUTINE, once I need to figure out what the COMPLICATED_ROUTINE will do, I have to navigate to IMPLEMENT_MY_FUNC first and then point to that COMPLICATED_ROUTINE.
2. I mean I would like to defined my own "reserved string" for example $MY_CODE_MARK$, which could be done by manually edit a ini file or registry entry or use the snippets editor, then I can insert it to any one of the snippets just like it's a built-in reserved string, and when I want to change the content of $MY_CODE_MARK$, I just need to update that one entry only and that's all.