Click here to Skip to main content
16,005,826 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionchanging default #defines in stdafx.h Pin
BlackDice29-Nov-05 4:44
BlackDice29-Nov-05 4:44 
AnswerRe: changing default #defines in stdafx.h Pin
Curtis Schlak.29-Nov-05 13:51
Curtis Schlak.29-Nov-05 13:51 
QuestionCDateTimeCtrl Questions Pin
#realJSOP29-Nov-05 4:15
professional#realJSOP29-Nov-05 4:15 
AnswerRe: CDateTimeCtrl Questions Pin
PJ Arends29-Nov-05 6:05
professionalPJ Arends29-Nov-05 6:05 
QuestionGDI+ cpu usage Pin
Alberto_Canabal29-Nov-05 3:48
Alberto_Canabal29-Nov-05 3:48 
AnswerRe: GDI+ cpu usage Pin
Shog929-Nov-05 11:39
sitebuilderShog929-Nov-05 11:39 
GeneralRe: GDI+ cpu usage Pin
Alberto_Canabal1-Dec-05 1:01
Alberto_Canabal1-Dec-05 1:01 
GeneralRe: GDI+ cpu usage Pin
Shog91-Dec-05 10:56
sitebuilderShog91-Dec-05 10:56 
Two suggestions:
1) You're drawing relative to the update rectangle. This is what's causing the "garbage" or unpainted areas on your window! For a stable drawing you want to always draw relative to the same area - in this case, the client area of the window. You can improve performance by clipping to the update area however.

2) If the window contents is stable, you'll get a *huge* improvement by double-buffering. Only redraw into the buffer when something changes, and only re-allocate the buffer when the window size changes. This can make the difference between 100% and 1-2% CPU usage while dragging a smaller window over the top of yours. Here also you can use the update rectangle to only blit the smallest possible amount of data from the back buffer to the screen.

Finally, hatch brushes are slow. The bulk of the time spent drawing in your test code is spent filling that big red hatched rectangle.

You must be careful in the forest
Broken glass and rusty nails
If you're to bring back something for us
I have bullets for sale...

GeneralRe: GDI+ cpu usage Pin
Alberto_Canabal2-Dec-05 7:29
Alberto_Canabal2-Dec-05 7:29 
GeneralRe: GDI+ cpu usage Pin
Shog92-Dec-05 7:51
sitebuilderShog92-Dec-05 7:51 
Questionto send data from parent window to child window Pin
sheshidar29-Nov-05 3:28
sheshidar29-Nov-05 3:28 
AnswerRe: to send data from parent window to child window Pin
Cedric Moonen29-Nov-05 3:47
Cedric Moonen29-Nov-05 3:47 
GeneralRe: to send data from parent window to child window Pin
sheshidar30-Nov-05 0:54
sheshidar30-Nov-05 0:54 
QuestionChange Thread Name in MFC Pin
Pixinger7729-Nov-05 3:09
Pixinger7729-Nov-05 3:09 
AnswerRe: Change Thread Name in MFC Pin
Blake Miller29-Nov-05 5:13
Blake Miller29-Nov-05 5:13 
GeneralRe: Change Thread Name in MFC Pin
Blake Miller29-Nov-05 6:32
Blake Miller29-Nov-05 6:32 
GeneralRe: Change Thread Name in MFC Pin
Pixinger7722-Dec-05 23:21
Pixinger7722-Dec-05 23:21 
QuestionHow I can read the value of CPU's program counter . Pin
Loc Milkyway29-Nov-05 3:07
Loc Milkyway29-Nov-05 3:07 
Questionpop-up menu problem, inside splitter, using doc/view Pin
l00p1n629-Nov-05 3:00
l00p1n629-Nov-05 3:00 
Questionproblem with DirectSound application Pin
8ki29-Nov-05 3:00
8ki29-Nov-05 3:00 
QuestionHow to use Enum::Parse properly Pin
DWOO29-Nov-05 2:54
DWOO29-Nov-05 2:54 
QuestionFilters (highpass, lowpass, bandpass) Pin
Obliterator29-Nov-05 2:49
Obliterator29-Nov-05 2:49 
AnswerRe: Filters (highpass, lowpass, bandpass) Pin
Russell'29-Nov-05 3:54
Russell'29-Nov-05 3:54 
AnswerRe: Filters (highpass, lowpass, bandpass) Pin
Chris Losinger29-Nov-05 5:01
professionalChris Losinger29-Nov-05 5:01 
QuestionTaking controll over... Pin
Larsson29-Nov-05 2:14
Larsson29-Nov-05 2: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.