Solved

Messages not handled when creating modeless dialog

Posted on 1998-12-18
2
203 Views
Last Modified: 2013-11-20
I am trying to create a modeless dialog within an ATL object using MFC.   If I call the CDialog::DoModal() method everything works fine.  All messages that I need are handled and the window works fine.

If I call CDialog::Create() however, I don't seem to get the chance to handle the standard messages like PreTranslateMessage or OnDestroy.  Why is this and how do I fix it?

0
Comment
Question by:tdietz
2 Comments
 
LVL 1

Expert Comment

by:Nevering
ID: 1326403
Is this an override class of CDialog, if so can you show some of the code.  It's possible that the message map may be messed up.
0
 
LVL 3

Accepted Solution

by:
shaig earned 50 total points
ID: 1326404
My guess is that the dialog is a temporary in a calling function.
when the scop of the calling function ends, the dialog die's.
The create function unlike DoModal returns imidiatly after creating the dialog rather then after it has been destroyed.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now