Re: How do controls get connected to variables in a CFormView?
CedricCicada@gmail.com wrote:
The controls are associated with variables by DDX_Control calls in
DoDataExchange of your view class. These calls are added automatically
by the wizard if you add the control variables this way: right-click on
the control in the dialog template, select Add Variable.
You can add the same calls by hand once you see what the wizard does for
one of them.
--
Scott McPhillips [MVP VC++]- Hide quoted text -
Scott,
Thank you for your reply. As near as I can tell, the code for the two
classes is the same. When does DDX_Control() first get called?
Should my variable be associated with a window by the time
OnInitialUpdate() gets called?
Rob
void CSDIView::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
}
The call to CView::OnInitialUpdate() causes the initial DDX_Control()
calls. So control variables first become ready to use at the TODO.
--
Scott McPhillips [MVP VC++]