Click here to Skip to main content
15,923,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Ho to Dowload File with HTP URL Pin
Hamid_RT25-Jul-06 18:55
Hamid_RT25-Jul-06 18:55 
GeneralRe: Ho to Dowload File with HTP URL Pin
huutribk200125-Jul-06 18:58
huutribk200125-Jul-06 18:58 
GeneralRe: Ho to Dowload File with HTP URL Pin
Hamid_RT25-Jul-06 19:13
Hamid_RT25-Jul-06 19:13 
Questionhow to make check box transparent under XP sytle [modified] Pin
Xueyan25-Jul-06 17:27
Xueyan25-Jul-06 17:27 
AnswerRe: how to make check box transparent under XP sytle Pin
Hamid_RT25-Jul-06 18:53
Hamid_RT25-Jul-06 18:53 
Generalto draw graph Pin
juliejayan@gmail.com25-Jul-06 17:21
juliejayan@gmail.com25-Jul-06 17:21 
GeneralRe: to draw graph Pin
_AnsHUMAN_ 25-Jul-06 17:28
_AnsHUMAN_ 25-Jul-06 17:28 
Questionactive-x control test container Pin
With_problem25-Jul-06 17:02
With_problem25-Jul-06 17:02 
AnswerRe: active-x control test container Pin
Steve Echols25-Jul-06 19:05
Steve Echols25-Jul-06 19:05 
GeneralRe: active-x control test container Pin
With_problem25-Jul-06 19:10
With_problem25-Jul-06 19:10 
QuestionRe: active-x control test container Pin
Steve Echols25-Jul-06 19:21
Steve Echols25-Jul-06 19:21 
QuestionCase Sensitive Pin
Chatura Dilan25-Jul-06 16:48
Chatura Dilan25-Jul-06 16:48 
AnswerRe: Case Sensitive Pin
Steve Echols25-Jul-06 19:13
Steve Echols25-Jul-06 19:13 
QuestionRe: Case Sensitive Pin
Hamid_RT25-Jul-06 19:31
Hamid_RT25-Jul-06 19:31 
AnswerRe: Case Sensitive Pin
Chatura Dilan25-Jul-06 22:13
Chatura Dilan25-Jul-06 22:13 
QuestionRe: Case Sensitive Pin
David Crow27-Jul-06 2:46
David Crow27-Jul-06 2:46 
QuestionImplementing a custom Dialogbox Pin
Kamal Shankar25-Jul-06 15:59
Kamal Shankar25-Jul-06 15:59 
AnswerRe: Implementing a custom Dialogbox Pin
spacecadet1025-Jul-06 16:25
spacecadet1025-Jul-06 16:25 
QuestionNeed help with ported c++ triangulation routine [modified] Pin
spacecadet1025-Jul-06 15:02
spacecadet1025-Jul-06 15:02 
AnswerRe: Need help with ported c++ triangulation routine Pin
Steve Echols25-Jul-06 20:35
Steve Echols25-Jul-06 20:35 
GeneralRe: Need help with ported c++ triangulation routine Pin
spacecadet1029-Jul-06 16:54
spacecadet1029-Jul-06 16:54 
Questionmfc drawing philosophy question - when is the correct time to draw? Pin
charlieg25-Jul-06 14:10
charlieg25-Jul-06 14:10 
I have some drawing code that seems to work *most of the time*. Trying to use some of this code today, I've encountered all sorts of odd behavior, and I'm questioning how I originally implemented this code. What I need from people who are deeper into Windows than I is the "why" of how painting/drawing in Windows actually works.

My app is dialog based. Some of the dialogs have to update graphics as fast as reasonably possible. So, early in my Windows development curve, I crafted my solution like so:

myclassdlg::OnInitDlg()
{
// set everything up...
// start a timer...

SetTimer (999, 500, NULL); // every 500ms
}

myclassdlg::OnTimer()
{
// do all of my drawing.
}

Now, based on various bits and pieces I've pulled together, this is just the wrong way to go about it. Unfortunately, it worked the first time, for whatever reason, and I've continued on my perilous ways. Well, now I've run into a problem, my new drawing code (based on the above style) doesn't work, so in my research, it appears that the correct way to do things is to start the timer but in the OnTimer loop, add an UpdateWindow() call to trigger the WM_PAINT message. The OnPaint handler than executes whatever drawing is necessary.

First question: do I have this right?

Second question: assuming I have this correct, what does the "draw in the OnPaint handler" apprach imply? It would seem that "this is the way you do it", but why? Does Windows do something special such that the graphics are guaranteed to draw?

Still getting my arms around this beast called Windows.

Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.

My son's PDA is an M249 SAW.

AnswerRe: mfc drawing philosophy question - when is the correct time to draw? Pin
User 58385225-Jul-06 15:09
User 58385225-Jul-06 15:09 
AnswerRe: mfc drawing philosophy question - when is the correct time to draw? Pin
Michael Dunn25-Jul-06 16:10
sitebuilderMichael Dunn25-Jul-06 16:10 
GeneralRe: mfc drawing philosophy question - when is the correct time to draw? Pin
charlieg25-Jul-06 16:45
charlieg25-Jul-06 16:45 

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.