Click here to Skip to main content
15,882,388 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAny suggestions? Pin
dellthinker20-Sep-07 20:00
dellthinker20-Sep-07 20:00 
AnswerRe: Any suggestions? Pin
John R. Shaw20-Sep-07 20:21
John R. Shaw20-Sep-07 20:21 
AnswerRe: Any suggestions? Pin
nbugalia20-Sep-07 20:51
nbugalia20-Sep-07 20:51 
QuestionRe: Any suggestions? Pin
David Crow21-Sep-07 2:53
David Crow21-Sep-07 2:53 
QuestionTimer in 10 Msec Pin
SURESH.SP20-Sep-07 19:42
SURESH.SP20-Sep-07 19:42 
AnswerRe: Timer in 10 Msec Pin
Cedric Moonen20-Sep-07 19:58
Cedric Moonen20-Sep-07 19:58 
AnswerRe: Timer in 10 Msec Pin
Roger Stoltz20-Sep-07 20:35
Roger Stoltz20-Sep-07 20:35 
AnswerRe: Timer in 10 Msec Pin
Randor 20-Sep-07 20:46
professional Randor 20-Sep-07 20:46 
You should be using multimedia timers for increased accuracy. A window timer must pass through the window message loop which will cause increased non-uniform intervals.

As Cédric stated, you cannot guarantee that the operating system will *always* fire the timer callback within a specified timeframe. This is because of how the XP/Vista and prior operating system kernels interrupts have been implemented. However you can ask the operating system to increase the resolution from its default value of 64Hz (about 15ms) to the maximum possible value.

#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")  

TIMECAPS tc;

if (TIMERR_NOERROR == timeGetDevCaps(&tc, sizeof(TIMECAPS)))
{
	TRACE1(_T("Setting system time resolution to: %d"),tc.wPeriodMin);
	timeBeginPeriod(tc.wPeriodMin);
}


http://msdn2.microsoft.com/en-us/library/ms713416.aspx[^]

Best Wishes,
Randor (David Delaune)
AnswerRe: Timer in 10 Msec Pin
ThatsAlok20-Sep-07 23:11
ThatsAlok20-Sep-07 23:11 
Question[Solved] cleanup, DestroyWindow or OnDestroy? [modified] Pin
Hamed Musavi20-Sep-07 17:37
Hamed Musavi20-Sep-07 17:37 
AnswerRe: cleanup, DestroyWindow or OnDestroy? Pin
DevMentor.org20-Sep-07 18:12
DevMentor.org20-Sep-07 18:12 
GeneralRe: cleanup, DestroyWindow or OnDestroy? Pin
Hamed Musavi20-Sep-07 18:38
Hamed Musavi20-Sep-07 18:38 
GeneralRe: cleanup, DestroyWindow or OnDestroy? Pin
DevMentor.org20-Sep-07 19:06
DevMentor.org20-Sep-07 19:06 
GeneralRe: cleanup, DestroyWindow or OnDestroy? Pin
Hamed Musavi20-Sep-07 20:16
Hamed Musavi20-Sep-07 20:16 
GeneralRe: cleanup, DestroyWindow or OnDestroy? Pin
DevMentor.org20-Sep-07 20:32
DevMentor.org20-Sep-07 20:32 
GeneralRe: cleanup, DestroyWindow or OnDestroy? Pin
Hamed Musavi20-Sep-07 21:17
Hamed Musavi20-Sep-07 21:17 
GeneralRe: cleanup, DestroyWindow or OnDestroy? Pin
DevMentor.org20-Sep-07 21:25
DevMentor.org20-Sep-07 21:25 
GeneralRe: cleanup, DestroyWindow or OnDestroy? Pin
Hamed Musavi20-Sep-07 22:33
Hamed Musavi20-Sep-07 22:33 
GeneralRe: cleanup, DestroyWindow or OnDestroy? Pin
DevMentor.org21-Sep-07 8:22
DevMentor.org21-Sep-07 8:22 
QuestionControlling other applications? Pin
Lord Kixdemp20-Sep-07 16:07
Lord Kixdemp20-Sep-07 16:07 
AnswerRe: Controlling other applications? Pin
Steve Echols20-Sep-07 16:51
Steve Echols20-Sep-07 16:51 
AnswerRe: Controlling other applications? Pin
nbugalia20-Sep-07 19:27
nbugalia20-Sep-07 19:27 
AnswerRe: Controlling other applications? Pin
ThatsAlok20-Sep-07 23:12
ThatsAlok20-Sep-07 23:12 
GeneralRe: Controlling other applications? Pin
Rajesh R Subramanian21-Sep-07 0:39
professionalRajesh R Subramanian21-Sep-07 0:39 
GeneralRe: Controlling other applications? Pin
ThatsAlok21-Sep-07 0:59
ThatsAlok21-Sep-07 0:59 

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.