Click here to Skip to main content
15,914,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: file browser in Win32 API / Visual C++ Pin
David Crow30-Nov-05 10:07
David Crow30-Nov-05 10:07 
QuestionWinHelp problem Pin
Raul Simcic30-Nov-05 9:00
Raul Simcic30-Nov-05 9:00 
AnswerRe: WinHelp problem Pin
David Crow30-Nov-05 9:12
David Crow30-Nov-05 9:12 
QuestionHow to make my program the highest priority Pin
jinzhecheng30-Nov-05 8:45
jinzhecheng30-Nov-05 8:45 
AnswerRe: How to make my program the highest priority Pin
Blake Miller30-Nov-05 9:20
Blake Miller30-Nov-05 9:20 
QuestionRe: How to make my program the highest priority Pin
David Crow30-Nov-05 9:27
David Crow30-Nov-05 9:27 
AnswerRe: How to make my program the highest priority Pin
jinzhecheng30-Nov-05 14:29
jinzhecheng30-Nov-05 14:29 
GeneralRe: How to make my program the highest priority Pin
David Crow1-Dec-05 3:44
David Crow1-Dec-05 3:44 
The first thing to note is that GetCurrentTime() has been deprecated by GetTickCount(). Second, calling SetThreadPriority() with a priority greater than 11 may cause disk caches to not flush, hang the mouse, and so on.

jinzhecheng wrote:
How can I ensure those steps are not interupted?


By using a critical section (e.g., InitializeCriticalSection()). I'm not sure you actually want to do this, however.

If you are simply wanting to time a section of code, GetTickCount() is the way to do this. Since Windows is not a RTOS, you'll not ever get 100% accuracy. For example, let's say that, per your watch, the code took 5 seconds to execute. However, span had a value of 6000, or 6 seconds. That means that the code was preempted for a total of 1000 ms. This is not necessarily a bad thing. It's much like weighing yourself at home on a scale that is not 100% accurate. Whether it shows you to be too heavy or too light, it doesn't matter as long as it's consistent. By comparing one weigh with another from the same scale, you can judge for yourself whether you are gaining or losing weight. Make sense?


"Take only what you need and leave the land as you found it." - Native American Proverb


Questionneed help input with hr : min Pin
pheradise30-Nov-05 7:08
pheradise30-Nov-05 7:08 
AnswerRe: need help input with hr : min Pin
David Crow30-Nov-05 7:58
David Crow30-Nov-05 7:58 
QuestionHow to disable automatic COMMAND_UI routing? Pin
ClockDivider30-Nov-05 6:43
ClockDivider30-Nov-05 6:43 
AnswerRe: How to disable automatic COMMAND_UI routing? Pin
ClockDivider30-Nov-05 8:02
ClockDivider30-Nov-05 8:02 
QuestionHow to get rid of "Untitled" in SDI app title bar? Pin
Ian Bowler30-Nov-05 6:37
Ian Bowler30-Nov-05 6:37 
AnswerRe: How to get rid of "Untitled" in SDI app title bar? Pin
toxcct30-Nov-05 6:46
toxcct30-Nov-05 6:46 
GeneralRe: How to get rid of "Untitled" in SDI app title bar? Pin
Ian Bowler30-Nov-05 6:52
Ian Bowler30-Nov-05 6:52 
GeneralRe: How to get rid of "Untitled" in SDI app title bar? Pin
toxcct30-Nov-05 7:01
toxcct30-Nov-05 7:01 
AnswerRe: How to get rid of "Untitled" in SDI app title bar? Pin
ClockDivider30-Nov-05 6:46
ClockDivider30-Nov-05 6:46 
AnswerRe: How to get rid of "Untitled" in SDI app title bar? Pin
David Crow30-Nov-05 8:00
David Crow30-Nov-05 8:00 
GeneralRe: How to get rid of "Untitled" in SDI app title bar? Pin
Ian Bowler30-Nov-05 6:53
Ian Bowler30-Nov-05 6:53 
AnswerRe: How to get rid of "Untitled" in SDI app title bar? Pin
Owner drawn30-Nov-05 19:27
Owner drawn30-Nov-05 19:27 
QuestionHelp to remove a level 4 warning Pin
Chris Meech30-Nov-05 5:44
Chris Meech30-Nov-05 5:44 
AnswerRe: Help to remove a level 4 warning Pin
Graham Bradshaw30-Nov-05 5:51
Graham Bradshaw30-Nov-05 5:51 
GeneralRe: Help to remove a level 4 warning Pin
Chris Meech30-Nov-05 6:13
Chris Meech30-Nov-05 6:13 
AnswerRe: Help to remove a level 4 warning Pin
Blake Miller30-Nov-05 9:25
Blake Miller30-Nov-05 9:25 
AnswerRe: Help to remove a level 4 warning Pin
Roland Pibinger30-Nov-05 9:41
Roland Pibinger30-Nov-05 9:41 

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.