Click here to Skip to main content
15,892,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: for loop Pin
sonyrehal17-Mar-09 21:39
sonyrehal17-Mar-09 21:39 
AnswerRe: for loop [modified] Pin
Cedric Moonen17-Mar-09 21:23
Cedric Moonen17-Mar-09 21:23 
QuestionHow to get control information about slider Pin
John50217-Mar-09 20:53
John50217-Mar-09 20:53 
AnswerRe: How to get control information about slider Pin
S p k 52117-Mar-09 21:04
S p k 52117-Mar-09 21:04 
QuestionSetWaitableTimer Issue:- CALLBACK function not getting called Pin
S p k 52117-Mar-09 20:48
S p k 52117-Mar-09 20:48 
AnswerRe: SetWaitableTimer Issue:- CALLBACK function not getting called Pin
Cedric Moonen17-Mar-09 21:14
Cedric Moonen17-Mar-09 21:14 
GeneralRe: SetWaitableTimer Issue:- CALLBACK function not getting called Pin
S p k 52117-Mar-09 22:29
S p k 52117-Mar-09 22:29 
GeneralRe: SetWaitableTimer Issue:- CALLBACK function not getting called Pin
Stuart Dootson18-Mar-09 0:36
professionalStuart Dootson18-Mar-09 0:36 
Your thread needs to be in an alertable state to execute the waitable timer completion routine. This page[^] and this page[^] may be of use/interest.

To illustrate - the code below executes the timer completion routine as expected. Change the TRUE to FALSE in the SleepEx call and it won't, as the thread's no longer in an alertable state.

#include <windows.h>
#include <iostream>

bool timerFired = false;

VOID CALLBACK completion(LPVOID lpArgToCompletionRoutine,
                           DWORD dwTimerLowValue, 
                           DWORD dwTimerHighValue)
{
   std::cout << "In completion routine\n";
}


int main(int, char**)
{
   if (HANDLE hTimer = CreateWaitableTimer(0, TRUE, 0))
   {
      __int64 due = -1000000LL;
      SetWaitableTimer(hTimer, (LARGE_INTEGER*)&due, 0, &completion, 0, TRUE);
      ::SleepEx(5000, TRUE);
      ::CloseHandle(hTimer);
   }
}


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: SetWaitableTimer Issue:- CALLBACK function not getting called Pin
S p k 52118-Mar-09 1:16
S p k 52118-Mar-09 1:16 
GeneralRe: SetWaitableTimer Issue:- CALLBACK function not getting called Pin
Stuart Dootson18-Mar-09 1:57
professionalStuart Dootson18-Mar-09 1:57 
GeneralRe: SetWaitableTimer Issue:- CALLBACK function not getting called Pin
S p k 52118-Mar-09 18:40
S p k 52118-Mar-09 18:40 
QuestionHow to establish a server in C++ : IP address issue Pin
includeh1017-Mar-09 19:00
includeh1017-Mar-09 19:00 
AnswerRe: How to establish a server in C++ : IP address issue Pin
Garth J Lancaster17-Mar-09 23:19
professionalGarth J Lancaster17-Mar-09 23:19 
AnswerRe: How to establish a server in C++ : IP address issue Pin
Iain Clarke, Warrior Programmer18-Mar-09 0:25
Iain Clarke, Warrior Programmer18-Mar-09 0:25 
QuestionLinking library help. Pin
FISH78617-Mar-09 14:42
FISH78617-Mar-09 14:42 
AnswerRe: Linking library help. Pin
Garth J Lancaster17-Mar-09 16:11
professionalGarth J Lancaster17-Mar-09 16:11 
GeneralRe: Linking library help. Pin
FISH78617-Mar-09 16:31
FISH78617-Mar-09 16:31 
GeneralRe: Linking library help. Pin
Garth J Lancaster17-Mar-09 17:05
professionalGarth J Lancaster17-Mar-09 17:05 
GeneralRe: Linking library help. Pin
FISH78617-Mar-09 17:51
FISH78617-Mar-09 17:51 
QuestionDigita Stop Watch Pin
Astitva2317-Mar-09 14:17
Astitva2317-Mar-09 14:17 
AnswerRe: Digita Stop Watch Pin
Garth J Lancaster17-Mar-09 14:32
professionalGarth J Lancaster17-Mar-09 14:32 
QuestionShowing an image to the use Pin
llp00na17-Mar-09 11:21
llp00na17-Mar-09 11:21 
AnswerRe: Showing an image to the use Pin
CPallini17-Mar-09 11:32
mveCPallini17-Mar-09 11:32 
GeneralRe: Showing an image to the use Pin
llp00na17-Mar-09 11:44
llp00na17-Mar-09 11:44 
QuestionRe: Showing an image to the use Pin
CPallini17-Mar-09 11:57
mveCPallini17-Mar-09 11:57 

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.