Click here to Skip to main content
15,889,200 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LNK4003 Pin
Allwyn D'souza20-Sep-05 7:20
Allwyn D'souza20-Sep-05 7:20 
GeneralRe: LNK4003 Pin
David Crow20-Sep-05 7:28
David Crow20-Sep-05 7:28 
GeneralRe: LNK4003 Pin
Allwyn D'souza20-Sep-05 7:34
Allwyn D'souza20-Sep-05 7:34 
GeneralRe: LNK4003 Pin
Allwyn D'souza20-Sep-05 7:45
Allwyn D'souza20-Sep-05 7:45 
QuestionRe: LNK4003 Pin
Allwyn D'souza20-Sep-05 7:59
Allwyn D'souza20-Sep-05 7:59 
QuestionMemory DCs Pin
Shutter19-Sep-05 6:22
Shutter19-Sep-05 6:22 
AnswerRe: Memory DCs Pin
Christian Graus19-Sep-05 11:33
protectorChristian Graus19-Sep-05 11:33 
GeneralRe: Memory DCs Pin
Jörgen Sigvardsson19-Sep-05 11:53
Jörgen Sigvardsson19-Sep-05 11:53 
Allocate the back buffer (memory dc and associated bitmap) in create, and resize in WM_SIZE handler. When I need to take resizing into consideration, I never shrink the bitmap. That gives an extra performance boost speedwise, but is perhaps not optimal in terms of memory. Classic tradeoff.

Don't fire invalidations inside your WM_ERASEBKGND handler. Just return TRUE if your aim is to avoid redrawing the background.


Shutter wrote:
2) When using a custom/ownerdraw for a listbox/listview/treeview, would it be best to use one memory DC for each item as it is being updated, or would it be faster to use a memdc for the entire window and redraw that?

It depends a lot on what you are drawing. If you are drawing simple text and/or an icon, then no memory dc is needed. If it's flickering, it's probably the result of your Invalidate() inside the WM_ERASEBKGND handler.


Shutter wrote:
Is there a trick that I'm not seeing?

The best trick I know of is to draw everything in a bitmap, and then blit it to the screen on WM_PAINT.

Generally I do:
* allocate a bitmap used for drawing, and I do it once (may be resized if the control/window is to be resized)
* all operations which alter the appearance of the window, draw to the back buffer. Then I invalidate the corresponding window rectangles, where the changes occurred
* in the WM_PAINT handler, I just blit the bitmap to screen

To make it fast as possible, make sure you only blit portions which need to be repainted.

Good music: In my rosary[^]
GeneralRe: Memory DCs Pin
Shutter19-Sep-05 12:47
Shutter19-Sep-05 12:47 
QuestionLarge data sets Pin
Obliterator19-Sep-05 5:37
Obliterator19-Sep-05 5:37 
AnswerRe: Large data sets Pin
Chris Losinger19-Sep-05 5:50
professionalChris Losinger19-Sep-05 5:50 
GeneralRe: Large data sets Pin
Obliterator19-Sep-05 6:11
Obliterator19-Sep-05 6:11 
AnswerRe: Large data sets Pin
Maximilien19-Sep-05 6:49
Maximilien19-Sep-05 6:49 
GeneralRe: Large data sets Pin
Obliterator19-Sep-05 7:25
Obliterator19-Sep-05 7:25 
GeneralRe: Large data sets Pin
ha_ha_ha19-Sep-05 8:42
ha_ha_ha19-Sep-05 8:42 
GeneralRe: Large data sets Pin
Obliterator21-Sep-05 4:15
Obliterator21-Sep-05 4:15 
GeneralRe: Large data sets Pin
ha_ha_ha23-Sep-05 5:06
ha_ha_ha23-Sep-05 5:06 
AnswerRe: Large data sets Pin
Bob Stanneveld19-Sep-05 8:06
Bob Stanneveld19-Sep-05 8:06 
GeneralRe: Large data sets Pin
Obliterator21-Sep-05 4:18
Obliterator21-Sep-05 4:18 
AnswerRe: Large data sets Pin
El Corazon19-Sep-05 8:49
El Corazon19-Sep-05 8:49 
GeneralRe: Large data sets Pin
Obliterator21-Sep-05 4:51
Obliterator21-Sep-05 4:51 
GeneralRe: Large data sets Pin
El Corazon21-Sep-05 6:06
El Corazon21-Sep-05 6:06 
GeneralRe: Large data sets Pin
Obliterator21-Sep-05 6:49
Obliterator21-Sep-05 6:49 
GeneralRe: Large data sets Pin
El Corazon21-Sep-05 15:21
El Corazon21-Sep-05 15:21 
GeneralRe: Large data sets Pin
Jörgen Sigvardsson19-Sep-05 10:43
Jörgen Sigvardsson19-Sep-05 10:43 

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.