BEGIN_MESSAGE_MAP Question



Dear people,

please consider the following code:

BEGIN_MESSAGE_MAP(CMyPropertyPage, CMyPropertyPageParent)
//{{AFX_MSG_MAP(CMyPropertyPage)
ON_BN_CLICKED(IDC_RADIO_1, &CMyPropertyPage::OnBnClickedRadioGroup)
ON_BN_CLICKED(IDC_RADIO_2, &CMyPropertyPage::OnBnClickedRadioGroup)
.
.
.
END_MESSAGE_MAP()
//}}AFX_MSG_MAP

Basically, I have a list of several radio buttons to which
members are added once in a while, but all are handled by
the same function. Because the list of buttons changes
constantly,I'd like to have them all in one place so I can't
forget to handle one. I stored the IDs along with some
extra information in a vector, I call the DDX_... macros
in a loop, but: (How) is it possible to circumvent the
above message map so I could map all the IDs in a
loop to the handler function?
.



Relevant Pages

  • Re: BEGIN_MESSAGE_MAP Question
    ... I stored the IDs along with some ... in a loop, but: is it possible to circumvent the ... You can put ON_CONTROL_RANGE in the message map. ... You can assign a contiguous range of IDs that you will use ...
    (microsoft.public.vc.mfc)
  • Re: message handling in dynamically created combobox
    ... Where is it engraved in stone that the only IDs you are allowed to use must be contained ... They way you add a handler to the message map at compile time is with a text editor! ... You indicate you are creating a singly dynamic combobox. ...
    (microsoft.public.vc.mfc)
  • Re: Getting notification for dynamically added controls
    ... see any way around keeping track of IDs externally. ... message map entries that don't require IDs? ... I changed the message map for DbListCtrl to this: ... void DbListCtrl::OnClickAny(UINT sourceId) ...
    (microsoft.public.vc.mfc)
  • Re: Please Help me Optimize my Code
    ... Dim myView As Data.DataView = myDataSet2.Tables.DefaultView ... I did not quite understand your logic with IDs - so if you could explain it ... I would declare a redOrdinal variable instead before the loop: ... It's just an autonumber field w/no duplicates. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: A loop to parse a large text file--output is empty!
    ... work, using the following script. ... create a lookup hash with the IDs of IDFILE ... in the while loop, first extract the string you want to test ... instead of the foreach loop below, ...
    (perl.beginners)