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

C / C++ / MFC

 
GeneralRe: Holy Dense... Codeguru Guru's Pin
Fred29-Jul-02 10:05
Fred29-Jul-02 10:05 
GeneralRe: Holy Dense... Codeguru Guru's Pin
Chad Koehler29-Jul-02 9:29
Chad Koehler29-Jul-02 9:29 
GeneralThanks.. Holy Dense... Codeguru Guru's Pin
Fred29-Jul-02 9:35
Fred29-Jul-02 9:35 
GeneralRe: Holy Dense... Codeguru Guru's Pin
Michael Dunn29-Jul-02 14:19
sitebuilderMichael Dunn29-Jul-02 14:19 
GeneralNasty little MFC bug... Pin
Anonymous29-Jul-02 5:59
Anonymous29-Jul-02 5:59 
GeneralRe: Nasty little MFC bug... Pin
#realJSOP29-Jul-02 6:07
professional#realJSOP29-Jul-02 6:07 
GeneralRe: Nasty little MFC bug... Pin
Christian Miller29-Jul-02 10:10
Christian Miller29-Jul-02 10:10 
GeneralNasty little MFC bug... Pin
Christian Miller29-Jul-02 5:59
Christian Miller29-Jul-02 5:59 
Greetings, coders of the world. I've come because I'm quite at the end of my rope with an MFC bug, and need help. It's the most untraceable thing I've ever come across...
Anyway, I hope I can provide enough information about it (without giving the whole program's source away) to get a solution.

I'm using VC++ 6.0 (rather than .net because of compatibility issues), and have based my program off the MDI structure. Now, _sometimes_ when I create floating modal dialog boxes, the program locks up. It only happens when the dialogs are ownerless (parent = NULL), and when they're called with the DoModal() function. It appears to vary by dialog. For a while, anything I brought up was freezing. Since then (I don't know why) the standard About dialog and various custom settings windows have begun to work. Others still don't. One baffling thing is that I override the exact same methods in two dialogs (derived from CDialog, of course), and one works while the other doesn't. I implemented, as a test, a little message responder and had it try to call one, then another, in separate compiles. No difference in calling environments that I could spot, and still only one worked.

As we're all more than familiar with, there are many ways for things to not work. What baffles me is where this one shows up... in the middle of MFC's message loop. The dialog object construct fine, but when I call DoModal(), it locks up the message loop. Specifically, this callstack:

USER32! 77e1325c()
CWinThread::PumpMessage() line 814 + 19 bytes
CWnd::RunModalLoop(unsigned long 4) line 3478 + 19 bytes
CDialog::DoModal() line 536 + 12 bytes

This is the culprit line in PumpMessage():
if (!::GetMessage(&m_msgCur, NULL, NULL, NULL))
and the program screeches to a halt (strangely) right on this assembler instruction in USER32:
ret 10h

Obviously, this doesn't help much. I can't figure out what I did elsewhere in my program that would cause the message loop to break like that. I did have a fairly large OpenGL section that messed with windows pretty heavily, but that wasn't the culprit. At first, I wrote routines that would completely shut down the OpenGL windows' message pumps whenever a modal dialog was called. It was ugly, but it worked... or so I thought. Since then, it's popped up again with different dialogs, and after ripping out the 3D system altogether (well, commenting out) to try to isolate this bug, still no change.

One last thing that might be helpful. I stepped through my dialog routines from DoModal(), but couldn't tell specifically where in the construction/display cycle the error occurred. The message loop appears to run fine for a while, but stops before the windows get around to calling PreCreateWindow().

The CDC thanks you in advance for any help you can provide.

-Christian Miller
GeneralApologies for the double post, blasted IE... [n/t] Pin
Christian Miller29-Jul-02 6:03
Christian Miller29-Jul-02 6:03 
GeneralTrouble with Z-order Pin
klm29-Jul-02 4:37
klm29-Jul-02 4:37 
GeneralRe: Trouble with Z-order Pin
Tomasz Sowinski29-Jul-02 4:48
Tomasz Sowinski29-Jul-02 4:48 
Generalword processor with page break Pin
DanYELL29-Jul-02 4:34
DanYELL29-Jul-02 4:34 
GeneralRe: word processor with page break Pin
l a u r e n29-Jul-02 7:17
l a u r e n29-Jul-02 7:17 
GeneralUser interface size and monitor resolution Pin
Antony B.29-Jul-02 3:52
sussAntony B.29-Jul-02 3:52 
GeneralRe: User interface size and monitor resolution Pin
l a u r e n29-Jul-02 7:21
l a u r e n29-Jul-02 7:21 
GeneralRe: User interface size and monitor resolution Pin
Allen Sun29-Jul-02 10:32
Allen Sun29-Jul-02 10:32 
GeneralRe: User interface size and monitor resolution Pin
Anotny B.29-Jul-02 23:47
sussAnotny B.29-Jul-02 23:47 
GeneralRe: User interface size and monitor resolution Pin
Michael P Butler29-Jul-02 10:46
Michael P Butler29-Jul-02 10:46 
QuestionTying several objects to one class function? Pin
tjkrz29-Jul-02 3:52
tjkrz29-Jul-02 3:52 
AnswerRe: Tying several objects to one class function? Pin
Tomasz Sowinski29-Jul-02 4:46
Tomasz Sowinski29-Jul-02 4:46 
Generalhigh priorities if paid, how to .... Pin
includeh1029-Jul-02 2:56
includeh1029-Jul-02 2:56 
GeneralRe: high priorities if paid, how to .... Pin
l a u r e n29-Jul-02 7:24
l a u r e n29-Jul-02 7:24 
GeneralOpen .eml file from IE Pin
peterchen29-Jul-02 2:49
peterchen29-Jul-02 2:49 
Generalhelp needed....! Pin
drmzunlimited29-Jul-02 2:37
drmzunlimited29-Jul-02 2:37 
GeneralRe: help needed....! Pin
Sharad Ganesh29-Jul-02 3:46
Sharad Ganesh29-Jul-02 3:46 

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.