Click here to Skip to main content
16,006,845 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalmodeless dialog in wtl Pin
ov5-Aug-01 11:17
ov5-Aug-01 11:17 
GeneralRe: modeless dialog in wtl Pin
Christian Graus5-Aug-01 13:47
protectorChristian Graus5-Aug-01 13:47 
GeneralRe: modeless dialog in wtl Pin
ov5-Aug-01 21:31
ov5-Aug-01 21:31 
GeneralRe: modeless dialog in wtl Pin
Todd Smith5-Aug-01 16:05
Todd Smith5-Aug-01 16:05 
GeneralRe: modeless dialog in wtl Pin
Michael Dunn5-Aug-01 21:14
sitebuilderMichael Dunn5-Aug-01 21:14 
GeneralRe: modeless dialog in wtl Pin
ov5-Aug-01 21:29
ov5-Aug-01 21:29 
GeneralRe: modeless dialog in wtl Pin
ov5-Aug-01 21:34
ov5-Aug-01 21:34 
GeneralRe: modeless dialog in wtl Pin
CodeGuy6-Aug-01 6:54
CodeGuy6-Aug-01 6:54 
From the WTL newsgroup (sign up! -- http://groups.yahoo.com/group/wtl)

From: "Tim Smith" <tim.smith@o...>
Date: Thu Jan 18, 2001 11:41 am
Subject: Re: DestroyWindow and OnFinalMessage ?


Here is a basic roadmap of what you need to do. First, inside your
dialog box class, you need make a new version of DialogProc. I just
copied the DialogProc from ATL.

Next, add a flag to your class called m_fDeferDelete. Initialize it
to false.

Inside your new DialogProc, in the WM_NCDESTROY clause after the call
to OnFinalMessage, add the following lines:

if (pThis ->m_pCurrentMsg == NULL)
delete pThis;
else
pThis ->m_fDeferDelete = true

Then in your new DialogProc, after the call to ProcessWindowMessage,
add the code:

if (pThis ->m_fDeferDelete && pOldMsg == NULL)
{
delete pThis;
return FALSE;
}

There might be a better way to do it, but this will work.

In my real code, I created a new base class that included an auto
delete flag. All my dialogs are based on this class. If the auto
delete flag is not set, then the dialog works normally. If it is
set, then the class self deletes as expected.
GeneralWho's using a file on the LAN Pin
5-Aug-01 11:17
suss5-Aug-01 11:17 
GeneralRe: Who's using a file on the LAN Pin
Todd Smith5-Aug-01 16:36
Todd Smith5-Aug-01 16:36 
GeneralSyntax Coloring Class Pin
5-Aug-01 10:44
suss5-Aug-01 10:44 
GeneralCScrollView::OnDraw() - problems Pin
Mike Gaskey5-Aug-01 10:35
Mike Gaskey5-Aug-01 10:35 
GeneralEnter touch kills dialog base window Pin
5-Aug-01 10:27
suss5-Aug-01 10:27 
GeneralRe: Enter touch kills dialog base window Pin
Baafie5-Aug-01 11:15
Baafie5-Aug-01 11:15 
GeneralCrypto API Pin
Peter Liddle5-Aug-01 7:18
Peter Liddle5-Aug-01 7:18 
Generaljust a question... Pin
roel5-Aug-01 5:32
roel5-Aug-01 5:32 
GeneralRe: just a question... Pin
Baafie5-Aug-01 5:56
Baafie5-Aug-01 5:56 
GeneralRe: just a question... Pin
roel5-Aug-01 6:17
roel5-Aug-01 6:17 
GeneralRe: just a question... Pin
Baafie5-Aug-01 6:25
Baafie5-Aug-01 6:25 
GeneralRe: just a question... Pin
roel5-Aug-01 12:05
roel5-Aug-01 12:05 
GeneralRe: just a question... Pin
Christian Graus5-Aug-01 13:44
protectorChristian Graus5-Aug-01 13:44 
GeneralRe: just a question... Pin
roel5-Aug-01 14:14
roel5-Aug-01 14:14 
GeneralRe: just a question... Pin
Christian Graus5-Aug-01 14:18
protectorChristian Graus5-Aug-01 14:18 
GeneralRe: just a question... Pin
Paolo Messina6-Aug-01 11:34
professionalPaolo Messina6-Aug-01 11:34 
GeneralRe: just a question... Pin
Todd Smith5-Aug-01 16:14
Todd Smith5-Aug-01 16:14 

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.