My CFormView-derived class is structured as follows:
class FormViewClass : public CFormView
{
...
FormViewClass();
void Initialize();
virtual void OnInitialUpdate();
...
};
Ideally, I would like to call the Initialize() function in the body of the constructor as follows:
FormViewClass::FormViewClass()
{
...
// originally I want to call Initialize function here
Initialize();
...
}
However, since I want this function to be responsible for all the initialization of this class when being created, and it contains MFC objects initializations such as combobox, edit control, checkbox control, radio button control, etc., should I be instead calling the Initialize() function here as I thought:
void FormViewClass::OnInitialUpdate()
{
// Should I call Initialize function instead here?
Initialize();
}
Currently I have non-MFC memory and object initialization in the constructor (hence calling Iniitalize() helper function in the constructor) and MFC object iniitalization in the OnIniitalUpdate() handler function. It would be great to hear your thoughts about it so that I can refactor the code properly. Thanks in advance.