MFC DDX and Serialization seem to be incompatible

  • Thread starter Thread starter PaltryProgrammer
  • Start date Start date
P

PaltryProgrammer

Guest
MFC DDX and Serialization seem to be incompatible.
[0] Created a Visual Studio New project MFC application C++ Application Type Dialog based named "MyDialog" utilizing the VS wizard.
[1] Inserted "public: DECLARE_SERIAL(CMyDialogDlg)" into the generated CMyDialogDlg class header.
[2] Inserted "IMPLEMENT_SERIAL(CMyDialogDlg, CObject, 0)" into the generated CMyDialogDlg class "MyDialog.cpp" implementation file.
[3] declared "public: void Serialize(CArchive& archive);" in the generated CMyDialogDlg class header.
[4] defined void CMyDialogDlg::Serialize(CArchive&) in the generated CMyDialogDlg class "MyDialog.cpp" implementation file.
[5] Built the project.
The problem now is that CMyDialogDlg::DoDataExchange(CDataExchange* pDX) is not called on creation of the dialog though it is called on pressing the "OK" button. Prior to Serialization it was called on both dialog creation and on pressing the "OK" button.
In advance I Thank You for assistance

Continue reading...
 
Back
Top