One possibility is to put all ID's of buttons in an array:

Code:
UINT aButtons[10] = { IDC_BUTTON1, IDC_BUTTON2, ....};
or create a struct/class

Code:
class CMyClass
{
  UINT m_id;
  int m_iChannelNr;
  virtual void MyFunction();
};
and put these class objects in an array. If necessary derive from your base class and use a different implementation for MyFunction() in the derived classes.
Hope this helps.