Click here to Skip to main content
15,887,241 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStructure/Class with optional data Pin
428826-Apr-10 3:14
428826-Apr-10 3:14 
AnswerRe: Structure/Class with optional data Pin
Chris Losinger26-Apr-10 3:18
professionalChris Losinger26-Apr-10 3:18 
AnswerRe: Structure/Class with optional data Pin
CPallini26-Apr-10 3:26
mveCPallini26-Apr-10 3:26 
AnswerRe: Structure/Class with optional data Pin
Eugen Podsypalnikov26-Apr-10 3:40
Eugen Podsypalnikov26-Apr-10 3:40 
AnswerRe: Structure/Class with optional data Pin
428826-Apr-10 3:51
428826-Apr-10 3:51 
QuestionRe: Structure/Class with optional data Pin
David Crow26-Apr-10 4:21
David Crow26-Apr-10 4:21 
AnswerRe: Structure/Class with optional data Pin
428826-Apr-10 4:35
428826-Apr-10 4:35 
Questiondialog contents disappear when covered, reappear when moved Pin
permutations26-Apr-10 2:27
permutations26-Apr-10 2:27 
I have a dialog box that's mostly working except for one thing. Under certain circumstances, if another window covers it for any reason, then when it's unhidden there is nothing in the dialog box until you move it slightly - no controls at all, just a gray background. I figure I need to stick an Invalidate() somewhere, but I can't figure out where.

The dialog box has a rich edit control and a bunch of buttons. Some of the buttons load different HTML files into the rich edit control (the HTML is converted to rich text). One of the buttons hides the rich edit control and displays a jpeg (which was easier than trying to load the jpeg into the rich edit control). One of the buttons prints whatever is displayed. If it's a rich edit control, it prints what's in it. If it's the jpeg, it prints that.

All this is working. I handle WM_PAINT so the jpeg is continually displayed if the window is resized or moved. OnPaint() checks the report type being displayed, and then if it's the image, it redisplays the image.

To fix the disappearing dialog controls after the window is hidden I added a handler for ON_ERASEBKGND that basically does the same thing as OnPaint(). If the jpeg is the current report, it redraws the jpeg. This works - but only for the jpeg. If the currently displayed report is in a rich edit control, every control in the dialog disappears after it's covered by another window - including the buttons. I've tried every combination of return values I can think of (0, 1, calling the base method), but nothing restores the controls except moving the dialog.

What am I missing? How do I get the dialog to redraw after being hidden when the rich edit control is being displayed?
AnswerRe: dialog contents disappear when covered, reappear when moved Pin
Code-o-mat26-Apr-10 3:36
Code-o-mat26-Apr-10 3:36 
Questionconvert CString to unsigned short Pin
Member 365375125-Apr-10 23:22
Member 365375125-Apr-10 23:22 
AnswerRe: convert CString to unsigned short Pin
Adam Roderick J25-Apr-10 23:39
Adam Roderick J25-Apr-10 23:39 
GeneralRe: convert CString to unsigned short Pin
Member 365375126-Apr-10 0:07
Member 365375126-Apr-10 0:07 
GeneralRe: convert CString to unsigned short Pin
Richard MacCutchan26-Apr-10 0:13
mveRichard MacCutchan26-Apr-10 0:13 
AnswerRe: convert CString to unsigned short Pin
Richard MacCutchan26-Apr-10 0:07
mveRichard MacCutchan26-Apr-10 0:07 
QuestionData encapsulation in C Pin
krish_kumar25-Apr-10 23:00
krish_kumar25-Apr-10 23:00 
AnswerRe: Data encapsulation in C Pin
Eugen Podsypalnikov25-Apr-10 23:17
Eugen Podsypalnikov25-Apr-10 23:17 
AnswerRe: Data encapsulation in C Pin
Moak25-Apr-10 23:41
Moak25-Apr-10 23:41 
GeneralRe: Data encapsulation in C Pin
SachinBhave25-Apr-10 23:57
SachinBhave25-Apr-10 23:57 
AnswerRe: Data encapsulation in C Pin
Adam Roderick J25-Apr-10 23:48
Adam Roderick J25-Apr-10 23:48 
AnswerRe: Data encapsulation in C Pin
Chris Losinger26-Apr-10 1:42
professionalChris Losinger26-Apr-10 1:42 
GeneralRe: Data encapsulation in C Pin
Nemanja Trifunovic26-Apr-10 5:09
Nemanja Trifunovic26-Apr-10 5:09 
AnswerRe: Data encapsulation in C Pin
Joe Woodbury26-Apr-10 6:24
professionalJoe Woodbury26-Apr-10 6:24 
Questionhow to get cdrom serial number Pin
EverettJF25-Apr-10 22:18
EverettJF25-Apr-10 22:18 
QuestionRe: how to get cdrom serial number Pin
CPallini25-Apr-10 22:27
mveCPallini25-Apr-10 22:27 
AnswerRe: how to get cdrom serial number Pin
EverettJF25-Apr-10 22:46
EverettJF25-Apr-10 22: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.