There is no such thing. A control is used by DDX because the corresponding DDX_* function is called in the DoDataExchange method of your dialog class. There is no table that you could parse and therefore you cannot dynamically determine which DDX_* function is called in your DoDataExchange method.
void CMySampleDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CReprendBudgetDlg)
DDX_Text(pDX, IDC_EDIT1, m_name1);
DDX_Text(pDX, IDC_EDIT2, m_name2);
//}}AFX_DATA_MAP
}
But you could "override" the DDX_* functions by some functions of your own that would put the control IDs in an array. So once the DoDataExchage function has been executed that array would contain all Control IDs used by DDX.
void AFXAPI MY_DDX_Text(CDataExchange* pDX, int nIDC, CString& value, CWordArray & ddxcontrols)
{
DDX_Text(pDX, nIDC, value);
if (!pDX->bSaveAndValidate)
ddxcontrols.Add(nIDC) ;
}
#define DDX_Text(a,b,c) MY_DDX_Text(a,b,c) // now we can continue to use DDX_Text
// and the Class Wizard will be happy
class CMySampleDlg : public CDialog
{
...
protected:
CWordArray m_ddxcontrols ; // array that will contain all control IDs use by DDX
...
}
void CMySampleDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CReprendBudgetDlg)
DDX_Text(pDX, IDC_EDIT1, m_name1, m_ddxcontrols);
DDX_Text(pDX, IDC_EDIT2, m_name2, m_ddxcontrols);
//}}AFX_DATA_MAP
}
So all you have to do is
- Write the MY_DDX_* functions for all DDX_* functions (they are
defined in afxdd_.h).
- In all your dialogs replace all calls to DDX_* functions my MY_DDX_* functions
- Put the m_ddxcontrols members in all your dialogs