Click here to Skip to main content
15,878,871 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to handle Blank Frame when recording a video Pin
huutribk200131-May-06 22:59
huutribk200131-May-06 22:59 
QuestionCreateProcessAsUserW fails in Windows 2003 64 bits Pin
alvaro31-May-06 22:58
alvaro31-May-06 22:58 
QuestionWindows Detruction Woes Pin
HakunaMatada31-May-06 22:41
HakunaMatada31-May-06 22:41 
AnswerRe: Windows Detruction Woes Pin
Nibu babu thomas31-May-06 23:10
Nibu babu thomas31-May-06 23:10 
GeneralRe: Windows Detruction Woes Pin
HakunaMatada31-May-06 23:22
HakunaMatada31-May-06 23:22 
GeneralRe: Windows Detruction Woes Pin
Nibu babu thomas31-May-06 23:26
Nibu babu thomas31-May-06 23:26 
GeneralRe: Windows Detruction Woes Pin
HakunaMatada31-May-06 23:33
HakunaMatada31-May-06 23:33 
GeneralRe: Windows Detruction Woes [modified] Pin
Nibu babu thomas31-May-06 23:37
Nibu babu thomas31-May-06 23:37 
TechyMaila wrote:
I am using the Win32API. No MFC. Could you tell me which Windows message is equivalent to CWnd::PostNcDestroy?


WM_NCDESTROY is the last message for a window.

The MFC implementation goes like this. MFC does some clean up in OnNcDestroy and then calls PostNcDestroy. The default implementation does nothing. So you will have to implement something like this.

From MSDN about PostNcDestroy:

The default implementation of CWnd::PostNcDestroy does nothing which is appropriate for window objects allocated on the stack frame or embedded in other objects. This is not appropriate for window objects that are designed to be allocated by themselves on the heap (not embedded in other C++ object).

Those classes that are designed to be allocated by themselves on the heap override the PostNcDestroy member function to perform a "delete this". This statement will free any C++ memory associated with the C++ object. Even though the default CWnd destructor calls DestroyWindow if m_hWnd is non-NULL, this does not lead to infinite recursion since the handle will be detached and NULL during the cleanup phase.


Nibu thomas
A Developer

Programming tips[^]  My site[^]

AnswerRe: Windows Detruction Woes Pin
Sarath C31-May-06 23:20
Sarath C31-May-06 23:20 
QuestionApplicatin as TrayIcon? Pin
bosfan31-May-06 21:28
bosfan31-May-06 21:28 
AnswerRe: Applicatin as TrayIcon? [modified] Pin
Amar Sutar31-May-06 21:38
Amar Sutar31-May-06 21:38 
GeneralRe: Applicatin as TrayIcon? Pin
Hamid_RT31-May-06 21:44
Hamid_RT31-May-06 21:44 
GeneralRe: Applicatin as TrayIcon? [modified] Pin
bosfan31-May-06 22:16
bosfan31-May-06 22:16 
AnswerRe: Applicatin as TrayIcon? Pin
Benoy Bose31-May-06 21:40
Benoy Bose31-May-06 21:40 
AnswerRe: Applicatin as TrayIcon? Pin
Benoy Bose31-May-06 21:42
Benoy Bose31-May-06 21:42 
AnswerRe: Applicatin as TrayIcon? Pin
Hamid_RT31-May-06 21:47
Hamid_RT31-May-06 21:47 
GeneralRe: Applicatin as TrayIcon? Pin
bosfan1-Jun-06 3:08
bosfan1-Jun-06 3:08 
Questionhow to compute set intersection efficiently? Pin
George_George31-May-06 21:18
George_George31-May-06 21:18 
AnswerRe: how to compute set intersection efficiently? Pin
David Crow1-Jun-06 4:58
David Crow1-Jun-06 4:58 
GeneralRe: how to compute set intersection efficiently? Pin
George_George1-Jun-06 18:41
George_George1-Jun-06 18:41 
GeneralRe: how to compute set intersection efficiently? Pin
David Crow2-Jun-06 2:51
David Crow2-Jun-06 2:51 
AnswerRe: how to compute set intersection efficiently? [modified] Pin
Stephen Hewitt1-Jun-06 14:20
Stephen Hewitt1-Jun-06 14:20 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
George_George1-Jun-06 18:45
George_George1-Jun-06 18:45 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
Stephen Hewitt1-Jun-06 18:54
Stephen Hewitt1-Jun-06 18:54 
GeneralRe: how to compute set intersection efficiently? [modified] Pin
George_George1-Jun-06 19:06
George_George1-Jun-06 19:06 

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.