Click here to Skip to main content
15,913,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionString Pin
Tiyani Miyambo6-Jul-09 0:18
Tiyani Miyambo6-Jul-09 0:18 
AnswerRe: String Pin
enhzflep6-Jul-09 0:43
enhzflep6-Jul-09 0:43 
AnswerRe: String Pin
Hamid_RT6-Jul-09 0:43
Hamid_RT6-Jul-09 0:43 
AnswerRe: String Pin
KarstenK6-Jul-09 2:48
mveKarstenK6-Jul-09 2:48 
AnswerRe: String Pin
TheGreatAndPowerfulOz6-Jul-09 10:51
TheGreatAndPowerfulOz6-Jul-09 10:51 
GeneralRe: String Pin
David Crow7-Jul-09 3:34
David Crow7-Jul-09 3:34 
GeneralRe: String Pin
TheGreatAndPowerfulOz16-Jul-09 8:30
TheGreatAndPowerfulOz16-Jul-09 8:30 
QuestionCreateTimerQueue() - questions about how it works? [modified] Pin
Souldrift5-Jul-09 23:40
Souldrift5-Jul-09 23:40 
I have a thread going on a little way down, about threads and timing. Now a question came up that I felt should go into a different thread.
I have the following code piece

HANDLE hTimerQueue = CreateTimerQueue();
HANDLE hTimer;
count = 0;
CreateTimerQueueTimer(&hTimer, hTimerQueue, (WAITORTIMERCALLBACK)&DoSendHere, 0 , 20, 0, WT_EXECUTEINTIMERTHREAD);

QueryPerformanceCounter(&liStart);
::SleepEx(60, TRUE);
//DeleteTimerQueueTimer( hTimerQueue, hTimer, NULL );
LONG lCount = count;
QueryPerformanceFrequency(&liFreq);
			
m_pLogger->Out( Logger::DEBUG, "RTPEngine: Time     = %f.\n", double(liEnd.QuadPart-liStart.QuadPart) / double(liFreq.QuadPart) );
m_pLogger->Out( Logger::DEBUG, "RTPEngine: Count    = %d.\n", lCount );
//DeleteTimerQueueTimer( hTimerQueue, hTimer, NULL );


The liEnd variable is filled in the callback function.
Several issues:
1. Like it is the callback func is called once (like intended) but the output gives a time of appx. 30ms, not 20ms. Actually the time is never the time I set up.
2. Why does it crash if I call DeleteTimerQueueTimer( hTimerQueue, hTimer, NULL ); after the output?

The output is this

RTPEngine: Timer callback activated.
RTPEngine: Time     = 0.030410.
RTPEngine: Count    = 1.
RTPEngine: Sending data package with size 480 (excluding header).
RTPEngine: Timer callback activated.
RTPEngine: Time     = 0.030192.
RTPEngine: Count    = 1.
RTPEngine: Sending data package with size 480 (excluding header).
RTPEngine: Timer callback activated.
RTPEngine: Time     = 0.030377.
RTPEngine: Count    = 1.


This is the output for a 9ms dueTime:

RTPEngine: Timer callback activated.
RTPEngine: Time     = 0.016252.
RTPEngine: Count    = 1.
RTPEngine: Sending data package with size 480 (excluding header).
RTPEngine: Timer callback activated.
RTPEngine: Time     = 0.014759.
RTPEngine: Count    = 1.
RTPEngine: Sending data package with size 480 (excluding header).
RTPEngine: Timer callback activated.
RTPEngine: Time     = 0.014178.
RTPEngine: Count    = 1.
RTPEngine: Sending data package with size 480 (excluding header).
RTPEngine: Timer callback activated.
RTPEngine: Time     = 0.014759.
RTPEngine: Count    = 1.


Souldrift

modified on Monday, July 6, 2009 5:53 AM

AnswerRe: CreateTimerQueue() - questions about how it works? Pin
Stuart Dootson6-Jul-09 0:12
professionalStuart Dootson6-Jul-09 0:12 
GeneralRe: CreateTimerQueue() - questions about how it works? Pin
Souldrift6-Jul-09 1:36
Souldrift6-Jul-09 1:36 
QuestionHow to read this type of text file in C/C++? Pin
Member 63711455-Jul-09 22:39
Member 63711455-Jul-09 22:39 
AnswerRe: How to read this type of text file in C/C++? Pin
Cedric Moonen5-Jul-09 22:43
Cedric Moonen5-Jul-09 22:43 
GeneralRe: How to read this type of text file in C/C++? Pin
Member 63711455-Jul-09 22:49
Member 63711455-Jul-09 22:49 
GeneralRe: How to read this type of text file in C/C++? Pin
Cedric Moonen5-Jul-09 23:21
Cedric Moonen5-Jul-09 23:21 
GeneralRe: How to read this type of text file in C/C++? Pin
Member 63711455-Jul-09 23:57
Member 63711455-Jul-09 23:57 
AnswerRe: How to read this type of text file in C/C++? Pin
CPallini5-Jul-09 23:31
mveCPallini5-Jul-09 23:31 
AnswerRe: How to read this type of text file in C/C++? Pin
Adam Roderick J6-Jul-09 5:53
Adam Roderick J6-Jul-09 5:53 
QuestionDatabase path Pin
MsmVc5-Jul-09 22:28
MsmVc5-Jul-09 22:28 
AnswerRe: Database path Pin
Stuart Dootson6-Jul-09 0:13
professionalStuart Dootson6-Jul-09 0:13 
Question[Message Deleted] [modified] Pin
rajapp5-Jul-09 21:24
rajapp5-Jul-09 21:24 
AnswerRe: how to add button control to a drawing Pin
Hamid_RT5-Jul-09 22:18
Hamid_RT5-Jul-09 22:18 
GeneralRe: how to add button control to a drawing Pin
rajapp6-Jul-09 0:30
rajapp6-Jul-09 0:30 
GeneralRe: how to add button control to a drawing Pin
Hamid_RT6-Jul-09 0:42
Hamid_RT6-Jul-09 0:42 
GeneralRe: how to add button control to a drawing Pin
chandu0046-Jul-09 1:56
chandu0046-Jul-09 1:56 
AnswerRe: how to add button control to a drawing Pin
Adam Roderick J6-Jul-09 6:01
Adam Roderick J6-Jul-09 6:01 

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.