Click here to Skip to main content
15,888,733 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLNK4003 Pin
Allwyn D'souza19-Sep-05 8:09
Allwyn D'souza19-Sep-05 8:09 
AnswerRe: LNK4003 Pin
David Crow19-Sep-05 10:31
David Crow19-Sep-05 10:31 
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 
I'm working on a project that involves quite a bit of graphical drawing using GDI, and thus I need to eliminate flicker using memory DCs. I've used them extensively in my program, but I think I have overused them, causing the drawing to be unnecessarily slow. (A listview, a listbox, a few buttons, and the background of the main window AFAIK)

Perhaps allocating the memory bitmap in WM_CREATE instead of WM_PAINT will speed up the painting some, keeping in mind I need to reallocate when the size changes too.

A couple of questions, because I've had some inconsistent results. (I use the memdc from atlgdix.h for you WTL devs)

1) In the WM_ERASEBKGND handler, I've found that if I do not use Invalidate(FALSE); (indicating to invalidate without erasing the background), sometimes the window does not get redrawn correctly. Is it proper practice to use a WM_ERASEBKGND handler that looks like this?

OnEraseBkgnd() // (prototype)<br />
{<br />
    Invalidate(false);<br />
    return true; // erased bkgnd<br />
}


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?

What I use now works, but seems unnecessarily slow, given that progs such as iTunes and WMP are extensively skinned and require lots of drawing, and I notice no flicker there. Is there a trick that I'm not seeing?

Thanks,

Shutter

-- modified at 12:22 Monday 19th September, 2005
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 
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 

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.