Click here to Skip to main content
15,901,426 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Drawing tool Pin
Paul M Watt6-Jun-02 19:45
mentorPaul M Watt6-Jun-02 19:45 
QuestionRelease mode TRACE? Pin
clintsinger6-Jun-02 10:16
clintsinger6-Jun-02 10:16 
AnswerRe: Release mode TRACE? Pin
John M. Drescher6-Jun-02 10:15
John M. Drescher6-Jun-02 10:15 
GeneralRe: Release mode TRACE? Pin
clintsinger6-Jun-02 10:26
clintsinger6-Jun-02 10:26 
AnswerRe: Release mode TRACE? Pin
PJ Arends6-Jun-02 19:18
professionalPJ Arends6-Jun-02 19:18 
Questioncustom control - how can you get mouse messages? Pin
Cathy6-Jun-02 9:29
Cathy6-Jun-02 9:29 
AnswerRe: custom control - how can you get mouse messages? Pin
Daniel Ferguson6-Jun-02 11:51
Daniel Ferguson6-Jun-02 11:51 
GeneralRe: custom control - how can you get mouse messages? Pin
Cathy6-Jun-02 11:59
Cathy6-Jun-02 11:59 
GeneralRe: custom control - how can you get mouse messages? Pin
Daniel Ferguson6-Jun-02 15:10
Daniel Ferguson6-Jun-02 15:10 
GeneralRe: custom control - how can you get mouse messages? Pin
Cathy6-Jun-02 19:56
Cathy6-Jun-02 19:56 
AnswerRe: custom control - how can you get mouse messages? Pin
aldeba8-Jun-02 21:55
aldeba8-Jun-02 21:55 
GeneralRe: custom control - how can you get mouse messages? Pin
Cathy9-Jun-02 6:35
Cathy9-Jun-02 6:35 
GeneralMultimap Error Pin
Sidney6-Jun-02 9:11
Sidney6-Jun-02 9:11 
GeneralRe: Multimap Error Pin
Joaquín M López Muñoz6-Jun-02 9:18
Joaquín M López Muñoz6-Jun-02 9:18 
GeneralRe: Multimap Error Pin
Sidney6-Jun-02 11:08
Sidney6-Jun-02 11:08 
GeneralRe: Multimap Error Pin
Christian Graus6-Jun-02 11:38
protectorChristian Graus6-Jun-02 11:38 
GeneralRe: Multimap Error Pin
Sidney6-Jun-02 12:18
Sidney6-Jun-02 12:18 
GeneralRe: Multimap Error Pin
Christian Graus6-Jun-02 12:48
protectorChristian Graus6-Jun-02 12:48 
GeneralRe: Multimap Error Pin
Sidney6-Jun-02 13:11
Sidney6-Jun-02 13:11 
GeneralRemoveAll question Pin
6-Jun-02 8:57
suss6-Jun-02 8:57 
GeneralRe: RemoveAll question Pin
Chris Losinger6-Jun-02 9:09
professionalChris Losinger6-Jun-02 9:09 
Questionhow to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 9:04
lucy6-Jun-02 9:04 
I have an SDI MFC application, and I use OnPaint() to draw something to my view. Since my view is updated very frequently, (less than 1 second), I am thinking of using memory DC to reduce the flickering. I tried this:

{
CPaintDC dc(this);
CDC memDc;
memDc.CreateCompatibleDC(&dc);

// create CPen, CBrush, 
// select them to memDc
// and draw using memDc.Ellipse, memDc.MoveTo, memDc.LineTo
// to get the shapes I need

// transfer to display
dc.BitBlt(0,
          0,
          displayWidth,
          displayHeight,
          &memDc,
          0,
          0,
          SRCCOPY);

// restore memDc
// delete all GDI object (CPen, CBrush)
memDc.DeleteDC();
}


but there is nothing on the display. The MSDN document said that I should select a bitmap to my memDc. I did so with a dummy blank bitmap resource I created using resource editor. After I select it to the memDc, there will only be the dummy bitmap displayed on my screen. How could I get my drawing displayed?Confused | :confused: Confused | :confused: Confused | :confused: Dead | X|
AnswerRe: how to do flicker-free drawing using memory DC Pin
Chris Losinger6-Jun-02 9:08
professionalChris Losinger6-Jun-02 9:08 
GeneralRe: how to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 9:19
lucy6-Jun-02 9:19 
GeneralRe: how to do flicker-free drawing using memory DC Pin
lucy6-Jun-02 9:28
lucy6-Jun-02 9:28 

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.