Dialog Box & Property Sheet :: MFC
Hi. I have some fundamental questions about dialog box and property sheet. Most ultimately have to do with program design and memory management.
Dialog Box:
Is the following good program design?
-----
MyBox mBox;
if (mBox.DoModal == IDOK)
// Is it good program design to get data from a dialog box after it has been closed/distroyed?
DataType = mBox.GetData();
-----
Dialog Box & Property Sheet:
What do you think about declare all dialog box and/or property sheets as private data member rather than local data member?
In general, I want to make sure there is not memory leak with dealing with dialog box and/or property sheet and local data members.
Thanks,
Kuphryn
data from property sheet or dialog
When destroyed you should not be able to retrieve data period. However after returning from .DoModal() you usually can. However, you cannot perform operations such as GetWindowText and the Like because the window has been destroyed although the object remains... The object is created when declared although the window is create upon calling Create or Domodal the object therefore remains after the window is destroyed and any data within it should be retrieve through member variables.