Click here to Skip to main content
16,006,605 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: counting the print Pin
toxcct15-Feb-07 20:17
toxcct15-Feb-07 20:17 
AnswerRe: counting the print Pin
David Crow15-Feb-07 5:34
David Crow15-Feb-07 5:34 
QuestionDestruction Order Pin
baerten15-Feb-07 3:59
baerten15-Feb-07 3:59 
AnswerRe: Destruction Order Pin
Gary R. Wheeler17-Feb-07 4:19
Gary R. Wheeler17-Feb-07 4:19 
QuestionRepainting in Win32 (WM_PAINT issues) Pin
deville7515-Feb-07 3:54
deville7515-Feb-07 3:54 
AnswerRe: Drawing Graph using GDI Pin
Cedric Moonen15-Feb-07 4:03
Cedric Moonen15-Feb-07 4:03 
GeneralRe: Drawing Graph using GDI Pin
deville7515-Feb-07 6:28
deville7515-Feb-07 6:28 
AnswerRe: Repainting in Win32 (WM_PAINT issues) Pin
Mark Salsbery15-Feb-07 6:17
Mark Salsbery15-Feb-07 6:17 
There's no need to only paint in response to a WM_PAINT.

Try breaking your drawing code into a separate method and call it from both the OnPaint()
and from OnTimer().
void MyDlgClass::DrawGraph(CDC &dc)
{
  ... draw graph to DC ...
}
 
void MyDlgClass::OnPaint() 
{
   CPaintDC dc(this);
   DrawGraph(dc);
}
 
void MyDlgClass::OnTimer(UINT_PTR nIDEvent)
{
   CWindowDC dc(this);
   DrawGraph(dc);
}

Also you shouldn't send WM_PAINT messages yourself. Use Invalidate() and UpdateWindow()
for an instant WM_PAINT message instead Smile | :)





Great job, team. Head back to base for debriefing and cocktails.

GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
deville7515-Feb-07 6:27
deville7515-Feb-07 6:27 
GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
Mark Salsbery15-Feb-07 6:32
Mark Salsbery15-Feb-07 6:32 
AnswerRe: Repainting in Win32 (WM_PAINT issues) Pin
Mark Salsbery15-Feb-07 6:27
Mark Salsbery15-Feb-07 6:27 
GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
deville7515-Feb-07 6:32
deville7515-Feb-07 6:32 
GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
Mark Salsbery15-Feb-07 6:34
Mark Salsbery15-Feb-07 6:34 
GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
deville7515-Feb-07 6:39
deville7515-Feb-07 6:39 
GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
Mark Salsbery15-Feb-07 6:41
Mark Salsbery15-Feb-07 6:41 
GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
Mark Salsbery15-Feb-07 7:10
Mark Salsbery15-Feb-07 7:10 
GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
Cedric Moonen15-Feb-07 7:51
Cedric Moonen15-Feb-07 7:51 
GeneralRe: Repainting in Win32 (WM_PAINT issues) Pin
Mark Salsbery15-Feb-07 9:46
Mark Salsbery15-Feb-07 9:46 
QuestionHow to run an application only in particular system? Pin
Super Hornet15-Feb-07 3:52
Super Hornet15-Feb-07 3:52 
AnswerRe: How to run an application only in particular system? Pin
deville7515-Feb-07 3:55
deville7515-Feb-07 3:55 
GeneralRe: How to run an application only in particular system? Pin
Super Hornet15-Feb-07 4:00
Super Hornet15-Feb-07 4:00 
GeneralRe: How to run an application only in particular system? Pin
toxcct15-Feb-07 4:01
toxcct15-Feb-07 4:01 
GeneralRe: How to run an application only in particular system? Pin
Super Hornet15-Feb-07 4:14
Super Hornet15-Feb-07 4:14 
GeneralRe: How to run an application only in particular system? Pin
toxcct15-Feb-07 4:19
toxcct15-Feb-07 4:19 
GeneralRe: How to run an application only in particular system? Pin
Super Hornet16-Feb-07 5:13
Super Hornet16-Feb-07 5:13 

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.