Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFile Writing / Win32 Pin
Fareed Rizkalla26-Apr-10 5:48
Fareed Rizkalla26-Apr-10 5:48 
QuestionRe: File Writing / Win32 Pin
David Crow26-Apr-10 5:55
David Crow26-Apr-10 5:55 
AnswerRe: File Writing / Win32 Pin
Richard MacCutchan26-Apr-10 6:25
mveRichard MacCutchan26-Apr-10 6:25 
QuestionHow to redirect stderr into CEdit control? Pin
Dimitris Vikeloudas26-Apr-10 5:48
Dimitris Vikeloudas26-Apr-10 5:48 
AnswerRe: How to redirect stderr into CEdit control? Pin
David Crow26-Apr-10 5:53
David Crow26-Apr-10 5:53 
GeneralRe: How to redirect stderr into CEdit control? Pin
Dimitris Vikeloudas26-Apr-10 6:11
Dimitris Vikeloudas26-Apr-10 6:11 
QuestionGenerate a usable library PDFlib Lite 7.0 Pin
mesajflaviu26-Apr-10 4:48
mesajflaviu26-Apr-10 4:48 
AnswerRe: Generate a usable library PDFlib Lite 7.0 Pin
Richard MacCutchan26-Apr-10 5:17
mveRichard MacCutchan26-Apr-10 5:17 
AnswerRe: Generate a usable library PDFlib Lite 7.0 Pin
Chris Meech26-Apr-10 7:30
Chris Meech26-Apr-10 7:30 
GeneralRe: Generate a usable library PDFlib Lite 7.0 Pin
mesajflaviu26-Apr-10 8:43
mesajflaviu26-Apr-10 8:43 
GeneralRe: Generate a usable library PDFlib Lite 7.0 Pin
mesajflaviu26-Apr-10 9:09
mesajflaviu26-Apr-10 9:09 
GeneralRe: Generate a usable library PDFlib Lite 7.0 Pin
Chris Meech27-Apr-10 2:29
Chris Meech27-Apr-10 2:29 
Questioni want to know some functions in vb to vc++ Pin
Member 365375126-Apr-10 3:19
Member 365375126-Apr-10 3:19 
AnswerRe: i want to know some functions in vb to vc++ Pin
CPallini26-Apr-10 3:30
mveCPallini26-Apr-10 3:30 
AnswerRe: i want to know some functions in vb to vc++ Pin
Dave Doknjas26-Apr-10 11:47
Dave Doknjas26-Apr-10 11:47 
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 

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.