Re: Odd MFC+GDI MDI problem
There could be many reasons why this is happening. You could have resource
leaks which take their toll on the system after a while and keeps windows
from drawing their content. Or it could be that a message gets lost, or some
data is not read in correctly, during the load process.
I would setup a few trace statments from the time you ask it to load
something to where it is displayed. Once you get a problem window check the
trace outputs and make sure that all the trace statments are there.
AliR.
"Randolpho" <randolpho@gmail.com> wrote in message
news:1156430726.031147.267520@75g2000cwc.googlegroups.com...
I've recently been tasked to troubleshoot a problem, and I'm stuck. I
didn't write the software, and the code is, frankly, a mess. I'm not
particularly strong with MFC, and there's no architectural
documentation or comments, and navigating the execution flow alone is
sapping all my time, so I thought I'd pause that for a moment and post
the symptoms. Maybe somebody has experienced this before and can tell
me better where to look.
The program is a simple "real-time data report" program that reads data
off a server on the network and displays a report about the constantly
changing data. It's drawn using GDI; it has no custom controls, it's
all hand-drawn, both text and graphics. It's an MDI program -- there
are several different report types, each running their own report in a
sub-window, and the user can create any number of reports for display
during execution. It has a save/load feature.
The problem is this: sometimes, for a reason that I cannot determine,
when the user loads multiple reports for display (either by save/load
or by creating a new report) the window is created, but nothing is
drawn to the surface -- I just get a standard MDI window frame
surrounding a blank white surface. The problem is that it's hit or
miss. Usually a bunch of windows can be loaded with no problems but
once the "blank window" issue starts, it's not consistent -- sometimes
a newly loaded/created report will work, sometimes it won't.
Exceptions and errors don't seem to explain the situation, either. The
windows themselves still work... they pump their messages, I can move
them around, etc. They just never seem to draw anything.
The issue was first noticed on dual-monitor computers, but a quickly
found workaround was to lower the bit-depth of the displays from 32 to
16 bit to even 8 bit colors. The issue shows itself earlier on a thin
clint machine, i.e. when running the pogram while connected to a
Terminal Services server or when the computer has fast user switching
turned on. That leads me to believe this might be a resource issue.
Perhaps a device context is not properly being obtained, or it has run
out of memory. The thing is, the program appears to think a DC was
obtained properly and continues drawing; it's just that nothing shows.
So, I'm stumped. Has anyone else ever encountered such an issue? How
can I conter it?