Click here to Skip to main content
15,903,736 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: #define not const? Pin
Stefan_Lang21-Oct-11 2:55
Stefan_Lang21-Oct-11 2:55 
QuestionPlaying video in particular dimensions Pin
VCProgrammer19-Oct-11 1:55
VCProgrammer19-Oct-11 1:55 
AnswerRe: Playing video in particular dimensions Pin
enhzflep19-Oct-11 2:35
enhzflep19-Oct-11 2:35 
QuestionCHtmlView and Windows 7 Pin
Member 810956018-Oct-11 22:57
Member 810956018-Oct-11 22:57 
QuestionTCP Communication Pin
john563218-Oct-11 19:15
john563218-Oct-11 19:15 
AnswerRe: TCP Communication Pin
Goto_Label_18-Oct-11 22:29
Goto_Label_18-Oct-11 22:29 
AnswerRe: TCP Communication Pin
Software_Developer18-Oct-11 22:56
Software_Developer18-Oct-11 22:56 
GeneralRe: TCP Communication Pin
john563218-Oct-11 23:45
john563218-Oct-11 23:45 
AnswerRe: TCP Communication Pin
App_18-Oct-11 23:07
App_18-Oct-11 23:07 
AnswerRe: TCP Communication Pin
jschell19-Oct-11 8:55
jschell19-Oct-11 8:55 
QuestionBeginPaint issues Pin
Waldermort18-Oct-11 9:08
Waldermort18-Oct-11 9:08 
AnswerRe: BeginPaint issues Pin
TheGreatAndPowerfulOz18-Oct-11 12:22
TheGreatAndPowerfulOz18-Oct-11 12:22 
GeneralRe: BeginPaint issues Pin
Waldermort18-Oct-11 21:00
Waldermort18-Oct-11 21:00 
GeneralRe: BeginPaint issues Pin
TheGreatAndPowerfulOz19-Oct-11 5:01
TheGreatAndPowerfulOz19-Oct-11 5:01 
AnswerRe: BeginPaint issues Pin
Chuck O'Toole18-Oct-11 12:52
Chuck O'Toole18-Oct-11 12:52 
GeneralRe: BeginPaint issues Pin
Waldermort18-Oct-11 21:03
Waldermort18-Oct-11 21:03 
GeneralRe: BeginPaint issues Pin
Chuck O'Toole18-Oct-11 23:04
Chuck O'Toole18-Oct-11 23:04 
GeneralRe: BeginPaint issues Pin
Waldermort19-Oct-11 3:46
Waldermort19-Oct-11 3:46 
It's too much code to simply paste here. You'll have to take my word for it that there is no way for the rect to be invalidated other than when I explicitly call for it.

My code works like this. bitmap A is updated from a thread. Thread calls InvalidateRect when done updating a frame. bitmap B contains the window background and doesn't change. bitmap C is a double buffer. When WM_PAINT arrives, call BeginPaint, alpha blend bitmap A with B onto C and BitBlt bitmap C to the screen. When done call EndPaint.

Like I said this is GDI 101, and I have never had a problem like this with previous versions of windows or Visual Studio.

As it stands now, calling ValidateRect from anywhere in the WM_PAINT handler solves the problem. I currently have it after the call to EndPaint. Without this call, WM_PAINT is being sent from window creation and always with the full client area. Even though at that time my drawing routines have not yet begun. And yes I do call Begin End on EVERY WM_PAINT.

On another note, passing the message onto DefWindowProc, after those two calls, also results in undesired behaviour. rectangles are being validated but not those that are in the paint struct.

I'm really beginning to think this is a bug.
Waldermort

GeneralRe: BeginPaint issues Pin
Chuck O'Toole19-Oct-11 5:02
Chuck O'Toole19-Oct-11 5:02 
GeneralRe: BeginPaint issues Pin
Waldermort19-Oct-11 5:41
Waldermort19-Oct-11 5:41 
Questionselect and accept socket calls Pin
vikramlinux18-Oct-11 8:33
vikramlinux18-Oct-11 8:33 
AnswerRe: select and accept socket calls Pin
Richard Andrew x6418-Oct-11 8:39
professionalRichard Andrew x6418-Oct-11 8:39 
AnswerRe: select and accept socket calls Pin
Chuck O'Toole18-Oct-11 10:37
Chuck O'Toole18-Oct-11 10:37 
QuestionHow to use a collection Pin
jkirkerx18-Oct-11 7:45
professionaljkirkerx18-Oct-11 7:45 
AnswerRe: How to use a collection Pin
Richard MacCutchan18-Oct-11 22:44
mveRichard MacCutchan18-Oct-11 22:44 

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.