Click here to Skip to main content
15,925,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Important programming truths ;) Pin
Lord Kixdemp14-Dec-05 12:20
Lord Kixdemp14-Dec-05 12:20 
QuestionOpenGL 2D tutorial? Pin
Lord Kixdemp10-Dec-05 9:29
Lord Kixdemp10-Dec-05 9:29 
AnswerRe: OpenGL 2D tutorial? Pin
El Corazon10-Dec-05 11:47
El Corazon10-Dec-05 11:47 
GeneralRe: OpenGL 2D tutorial? Pin
Lord Kixdemp10-Dec-05 18:07
Lord Kixdemp10-Dec-05 18:07 
GeneralRe: OpenGL 2D tutorial? Pin
El Corazon10-Dec-05 18:26
El Corazon10-Dec-05 18:26 
QuestionPreventing a property sheet from highlighting the OK button. Pin
paper6710-Dec-05 9:04
paper6710-Dec-05 9:04 
QuestionFlickering in Screen while drawing Pin
Sanjoy Sinharoy10-Dec-05 8:19
Sanjoy Sinharoy10-Dec-05 8:19 
AnswerRe: Flickering in Screen while drawing Pin
Jörgen Sigvardsson10-Dec-05 13:38
Jörgen Sigvardsson10-Dec-05 13:38 
Have you tried WS_CLIPCHILDREN (Clip Children property in the designer)?

When I draw something that needs to be flicker free, I usually use a backbuffer bitmap, to which I connect a memory dc. I then paint to the memory dc, and blit it wherever I want it shown. I also make sure I don't let the background in the picture area to be redrawn, because that's the root of all evil flickering.

The general solution I apply is to create a new window class, and call it Canvas or something like that. In its WM_ERASEBKGND handler, I don't do anything. I just return TRUE to signal that the background has been erased. I then set the WS_CLIPCHILDREN style on its parent. The window class maintain the backbuffer bitmap and memory dc, which is used for drawing operations. Whenever the control needs to redraw itself in the WM_PAINT handler, I just blit the bitmap to the window dc. No flickering... (and also reusable!)

--
Pictures[^] from my Japan trip.
QuestionCString and Huge SQL Queries Pin
sdancer7510-Dec-05 6:54
sdancer7510-Dec-05 6:54 
AnswerRe: CString and Huge SQL Queries Pin
Michael P Butler10-Dec-05 8:03
Michael P Butler10-Dec-05 8:03 
AnswerRe: CString and Huge SQL Queries Pin
David Crow10-Dec-05 16:41
David Crow10-Dec-05 16:41 
AnswerRe: CString and Huge SQL Queries Pin
Tim Smith11-Dec-05 6:41
Tim Smith11-Dec-05 6:41 
AnswerRe: CString and Huge SQL Queries Pin
AORD11-Dec-05 21:09
AORD11-Dec-05 21:09 
GeneralRe: CString and Huge SQL Queries Pin
sdancer7511-Dec-05 22:34
sdancer7511-Dec-05 22:34 
Questionplease help me Pin
dSolariuM10-Dec-05 4:23
dSolariuM10-Dec-05 4:23 
AnswerRe: please help me Pin
Alex Orovetskiy10-Dec-05 6:08
Alex Orovetskiy10-Dec-05 6:08 
AnswerRe: please help me Pin
Curtis Schlak.10-Dec-05 11:09
Curtis Schlak.10-Dec-05 11:09 
QuestionButton press simulation Pin
paper6710-Dec-05 3:36
paper6710-Dec-05 3:36 
AnswerRe: Button press simulation Pin
squidev10-Dec-05 8:03
squidev10-Dec-05 8:03 
GeneralRe: Button press simulation Pin
paper6710-Dec-05 8:44
paper6710-Dec-05 8:44 
QuestionRe: Button press simulation Pin
David Crow10-Dec-05 16:43
David Crow10-Dec-05 16:43 
GeneralRe: Button press simulation Pin
FarPointer11-Dec-05 1:56
FarPointer11-Dec-05 1:56 
QuestionPhysical path of running process? Pin
manojk_batra10-Dec-05 3:01
manojk_batra10-Dec-05 3:01 
AnswerRe: Physical path of running process? Pin
Alex Orovetskiy10-Dec-05 6:05
Alex Orovetskiy10-Dec-05 6:05 
GeneralRe: Physical path of running process? Pin
manojk_batra11-Dec-05 1:14
manojk_batra11-Dec-05 1:14 

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.