Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to copy and paste files and folders programmely. Pin
Alexander M.,21-May-05 13:05
Alexander M.,21-May-05 13:05 
GeneralRe: How to copy and paste files and folders programmely. Pin
chocm21-May-05 18:20
chocm21-May-05 18:20 
GeneralRe: How to copy and paste files and folders programmely. Pin
Alexander M.,22-May-05 3:11
Alexander M.,22-May-05 3:11 
GeneralRe: How we determine the following? Pin
toxcct21-May-05 7:37
toxcct21-May-05 7:37 
GeneralRe: How we determine the following? Pin
S.DARWIN PAUL RAJ21-May-05 21:38
S.DARWIN PAUL RAJ21-May-05 21:38 
GeneralRe: How we determine the following? Pin
toxcct22-May-05 5:07
toxcct22-May-05 5:07 
GeneralRe: Merging the resource files (*.rc) Pin
doublebug24-May-05 10:09
doublebug24-May-05 10:09 
QuestionHow to destroy a window? VC++ 6.0 & MFC Pin
Mark Becker20-May-05 19:58
Mark Becker20-May-05 19:58 
Hello -

I read through a Samm's book... I read through Petzold.. and I still don't have a handle on this.

I am writing software to analyze a bunch of data with the data organized in columns. The general plan is to use the dialog model and open a sub-dialog for each column of data.

No problems creating sub-dialogs. It's destroying them that is confusing me.
Say that I setup, create, and activate a dialog using Create() and ShowWindow().
Now comes time to destroy the window.

I see a variety of ways of doing this:

1. The sub-dialog (an MFC-derived class) executes this->Destroy(). This seems wrong as a class is deleting itself without notifying the parent class.

2. A call-back function destroys the class. This seems reasonable.. except that the child calling the call-back that is part of the parent class winds up calling the child's Destroy() and control eventually returns to a destroyed class. Which ruins the idea.

Somewhere in the MFC documentation, it says that calling a sub-dialog's Destroy() function deletes the window.. but that the class's must be deleted to destroy the underlying data structures.

By this point my eyes are crossing.. and I could use a tip.

Regards,

Mark
AnswerRe: How to destroy a window? VC++ 6.0 & MFC Pin
MK7820-May-05 20:51
MK7820-May-05 20:51 
Generalstring vs CString Pin
Steve Messer20-May-05 19:18
Steve Messer20-May-05 19:18 
GeneralRe: string vs CString Pin
Hendy_So20-May-05 21:05
Hendy_So20-May-05 21:05 
GeneralRe: string vs CString Pin
Steve Messer20-May-05 21:12
Steve Messer20-May-05 21:12 
GeneralRe: string vs CString Pin
peterchen21-May-05 10:22
peterchen21-May-05 10:22 
GeneralRe: string vs CString Pin
Steve Messer21-May-05 11:15
Steve Messer21-May-05 11:15 
GeneralRe: string vs CString Pin
peterchen21-May-05 11:39
peterchen21-May-05 11:39 
GeneralRe: string vs CString Pin
Steve Messer21-May-05 12:15
Steve Messer21-May-05 12:15 
GeneralRe: string vs CString Pin
Bob Stanneveld22-May-05 1:26
Bob Stanneveld22-May-05 1:26 
GeneralRe: string vs CString Pin
Tim Smith22-May-05 3:54
Tim Smith22-May-05 3:54 
GeneralRe: string vs CString Pin
peterchen22-May-05 5:15
peterchen22-May-05 5:15 
GeneralRefresh DataGrid when closing dialog Pin
dafatdude20-May-05 19:09
dafatdude20-May-05 19:09 
GeneralWhich is faster... Pin
NeverFall20-May-05 15:35
NeverFall20-May-05 15:35 
GeneralRe: Which is faster... Pin
mkuhac20-May-05 16:19
mkuhac20-May-05 16:19 
GeneralRe: Which is faster... Pin
rocky_pulley20-May-05 16:51
rocky_pulley20-May-05 16:51 
GeneralRe: Which is faster... Pin
NeverFall20-May-05 18:31
NeverFall20-May-05 18:31 
GeneralRe: Which is faster... Pin
peterchen21-May-05 11:27
peterchen21-May-05 11:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.