I need to open a dialog box created from the same class twice. When i try this
CdelmeDlg dlg;
dlg.DoModal();
dlg.DoModal();
The second call opens the dialogue only for a split second, then it closes. My bet was that there is a message remaining in the message queue, so I added this between calls
MSG msgCur;
while (::PeekMessage(&msgCur, NULL, NULL, NULL, PM_REMOVE))
;
This solves the problem, but it seems like the wrong thing. Is there a way to properly handle the remaining message?
source
share