Click here to Skip to main content
15,919,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDevelop FTA Tool Help Pin
XiaoYu20-Jan-05 13:41
XiaoYu20-Jan-05 13:41 
Questionhow to get the usb device's disk name,like "H:"? Pin
lowiq20-Jan-05 13:41
lowiq20-Jan-05 13:41 
GeneralCatching Keyboard events Pin
FayezElFar20-Jan-05 11:47
FayezElFar20-Jan-05 11:47 
GeneralRe: Catching Keyboard events Pin
Blake Miller21-Jan-05 8:59
Blake Miller21-Jan-05 8:59 
GeneralNo Updates When Loss Focus Pin
Grahamfff20-Jan-05 10:26
Grahamfff20-Jan-05 10:26 
GeneralRe: No Updates When Loss Focus Pin
Mircea Puiu21-Jan-05 0:24
Mircea Puiu21-Jan-05 0:24 
GeneralRe: No Updates When Loss Focus Pin
Grahamfff22-Jan-05 10:10
Grahamfff22-Jan-05 10:10 
QuestionCall OnClose or PostNcDestroy? Pin
Anonymous20-Jan-05 10:03
Anonymous20-Jan-05 10:03 
I am creating dialogs and want to do some custom cleanup upon destroying the dialog, whether it be via the X on the dialog window, the Escape button, or terminating the window application that it is running in. To account for the Escape key, I am currently overriding my dialog's OnCancel() function so that when I press Escape, it calls OnClose() to do cleanup. I also override PostNcDestroy to add additional cleanup, such as deleting the this pointer. However, I am not sure whether it is necessary to override both of these functions. I noticed that only PostNcDestroy() is called when terminating the windows application, and thus the custom cleanup in OnClose() was not executed. My question is: do I just need to call PostNcDestroy and do all my custom cleanup in this function? And why?

void CDlgClass::OnCancel()
{
OnClose(); or PostNcDestroy();???
}

Thanks!
AnswerRe: Call OnClose or PostNcDestroy? Pin
Blake Miller20-Jan-05 11:12
Blake Miller20-Jan-05 11:12 
AnswerRe: Call OnClose or PostNcDestroy? Pin
Shog920-Jan-05 13:22
sitebuilderShog920-Jan-05 13:22 
AnswerRe: Call OnClose or PostNcDestroy? Pin
David Crow21-Jan-05 10:19
David Crow21-Jan-05 10:19 
GeneralCButton Pin
poiut20-Jan-05 9:59
poiut20-Jan-05 9:59 
GeneralRe: CButton Pin
Maximilien20-Jan-05 10:10
Maximilien20-Jan-05 10:10 
GeneralRe: CButton Pin
poiut20-Jan-05 10:22
poiut20-Jan-05 10:22 
GeneralRe: CButton Pin
Blake Miller20-Jan-05 11:09
Blake Miller20-Jan-05 11:09 
GeneralRe: CButton Pin
BlackDice20-Jan-05 11:51
BlackDice20-Jan-05 11:51 
GeneralWeb Browser Control won't display applets Pin
dlarkin7720-Jan-05 9:43
dlarkin7720-Jan-05 9:43 
Generalpointers to objects in lists Pin
Jordan C. Atlas20-Jan-05 9:20
Jordan C. Atlas20-Jan-05 9:20 
GeneralRe: pointers to objects in lists Pin
Christian Graus20-Jan-05 10:14
protectorChristian Graus20-Jan-05 10:14 
GeneralRe: pointers to objects in lists Pin
Jordan C. Atlas20-Jan-05 10:27
Jordan C. Atlas20-Jan-05 10:27 
GeneralRe: pointers to objects in lists Pin
Christian Graus20-Jan-05 10:33
protectorChristian Graus20-Jan-05 10:33 
GeneralRe: pointers to objects in lists Pin
markkuk20-Jan-05 11:00
markkuk20-Jan-05 11:00 
GeneralRe: pointers to objects in lists Pin
Christian Graus20-Jan-05 11:04
protectorChristian Graus20-Jan-05 11:04 
Generalncb file in the VS.net project Pin
jerry1211a20-Jan-05 8:43
jerry1211a20-Jan-05 8:43 
GeneralRe: ncb file in the VS.net project Pin
Maximilien20-Jan-05 8:45
Maximilien20-Jan-05 8:45 

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.