Click here to Skip to main content
15,912,204 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: What is the difference among the OnClose(),OnDestroy() and the DestroyWindow()? Pin
aygrhnwms30427-Sep-08 21:02
aygrhnwms30427-Sep-08 21:02 
AnswerRe: What is the difference among the OnClose(),OnDestroy() and the DestroyWindow()? Pin
Ali Tavakol28-Sep-08 4:47
Ali Tavakol28-Sep-08 4:47 
AnswerRe: What is the difference among the OnClose(),OnDestroy() and the DestroyWindow()? Pin
Michael Dunn28-Sep-08 12:34
sitebuilderMichael Dunn28-Sep-08 12:34 
Questionreading text file Pin
nomi khan27-Sep-08 12:55
nomi khan27-Sep-08 12:55 
AnswerRe: reading text file Pin
David Crow27-Sep-08 16:40
David Crow27-Sep-08 16:40 
AnswerRe: reading text file Pin
Hamid_RT29-Sep-08 7:31
Hamid_RT29-Sep-08 7:31 
QuestionMessage Queues for MFC windows classes Pin
sawerr27-Sep-08 7:51
sawerr27-Sep-08 7:51 
AnswerRe: Message Queues for MFC windows classes Pin
Mark Salsbery27-Sep-08 8:24
Mark Salsbery27-Sep-08 8:24 
sawerr wrote:
We know that Windows keeps a message queue for every thread.


Only if you call a function that causes a queue to be created on a thread.

sawerr wrote:
for win32 applications, only one message loop is enough.


Yes, one is sufficient, but not necessary unless you create at least one window.
For example, you don't need a message loop in a console app.

sawerr wrote:
Do all of the message map macros that we see in the source code indicate there is a message loop that buried in MFC source code?


Yes, but not a separate message loop for each window/class.
There's still one per UI thread. See the source code for
CWinThread::Run() - the per-thread message loop is there.
The CWinApp class derives from CWinThread, so for an MFC GUI app,
your required CWinApp object generally provides the first/main
message loop.

Once messages are extracted from the queue in a message loop, then
they are dispatched to their destination window via a call to the destination
window's windowproc (window procedure). That's basic Windows windowing[^].
The message map table macros generate compiled code that maps a message
received in the windowproc to a call to the appropriate window class method.

Hope that makes a little sense.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Message Queues for MFC windows classes Pin
sawerr27-Sep-08 9:58
sawerr27-Sep-08 9:58 
GeneralRe: Message Queues for MFC windows classes Pin
Mark Salsbery27-Sep-08 10:08
Mark Salsbery27-Sep-08 10:08 
GeneralRe: Message Queues for MFC windows classes Pin
sawerr27-Sep-08 10:46
sawerr27-Sep-08 10:46 
Questionan always-wrong password Pin
Joseph Marzbani27-Sep-08 4:50
Joseph Marzbani27-Sep-08 4:50 
AnswerRe: an always-wrong password Pin
Paul Conrad27-Sep-08 7:18
professionalPaul Conrad27-Sep-08 7:18 
AnswerRe: an always-wrong password Pin
Iain Clarke, Warrior Programmer27-Sep-08 11:23
Iain Clarke, Warrior Programmer27-Sep-08 11:23 
QuestionHow to decode a wav file Pin
ice87111727-Sep-08 4:04
ice87111727-Sep-08 4:04 
JokeRe: How to decode a wav file Pin
followait27-Sep-08 4:11
followait27-Sep-08 4:11 
GeneralRe: How to decode a wav file Pin
Joseph Marzbani27-Sep-08 4:54
Joseph Marzbani27-Sep-08 4:54 
QuestionRe: How to decode a wav file [modified] Pin
CPallini27-Sep-08 6:04
mveCPallini27-Sep-08 6:04 
AnswerRe: How to decode a wav file Pin
Hamid_RT29-Sep-08 7:28
Hamid_RT29-Sep-08 7:28 
AnswerRe: How to decode a wav file Pin
Hamid_RT29-Sep-08 7:27
Hamid_RT29-Sep-08 7:27 
QuestionPrint all the running Applications using C++, win APIs. Pin
Subrat 470826627-Sep-08 1:16
Subrat 470826627-Sep-08 1:16 
AnswerRe: Print all the running Applications using C++, win APIs. Pin
CPallini27-Sep-08 1:21
mveCPallini27-Sep-08 1:21 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
Subrat 470826627-Sep-08 2:46
Subrat 470826627-Sep-08 2:46 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
CPallini27-Sep-08 3:28
mveCPallini27-Sep-08 3:28 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
Subrat 470826627-Sep-08 3:51
Subrat 470826627-Sep-08 3:51 

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.