Click here to Skip to main content
15,891,907 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A Discrete Mathematic problem. Pin
Alexander M.,19-Jan-04 2:14
Alexander M.,19-Jan-04 2:14 
GeneralPopup menu pops up in wrong place Pin
Daniel132418-Jan-04 11:18
Daniel132418-Jan-04 11:18 
GeneralRe: Popup menu pops up in wrong place Pin
PJ Arends18-Jan-04 16:31
professionalPJ Arends18-Jan-04 16:31 
GeneralRe: Popup menu pops up in wrong place Pin
Michael Dunn18-Jan-04 16:31
sitebuilderMichael Dunn18-Jan-04 16:31 
GeneralRe: Popup menu pops up in wrong place Pin
Roger Allen18-Jan-04 23:51
Roger Allen18-Jan-04 23:51 
GeneralRe: Popup menu pops up in wrong place Pin
Daniel132419-Jan-04 0:51
Daniel132419-Jan-04 0:51 
GeneralRe: Popup menu pops up in wrong place Pin
фил21-Jan-04 4:50
фил21-Jan-04 4:50 
GeneralSetWaitableTimer Pin
Mikey_E18-Jan-04 10:23
professionalMikey_E18-Jan-04 10:23 
I'm trying to set a waitable timer from a CTime object. So I'm doing converstion from CTime to SYSTEMTIME then to a FILETIME and finally to a LARGE_INTEGER structure so I can pass it to SetWaitableTimer.

This compiles and runs, however my timer fires immediately every time. It's completely ignoring the time to fire on. Am I making these converstions wrong or just completely flubbing the whole thing up? I'm lost, any help would be very appreciated!!



CTime m_tNextRun(Schedule.GetNextRunTime());
// Convert m_tNextRun to a SYSTEMTIME structure
SYSTEMTIME m_st_DueTime;
m_tNextRun.GetAsSystemTime(m_st_DueTime);

// Convert m_st_DueTime to a FILETIME structure
FILETIME m_ft_DueTime;
::SystemTimeToFileTime(&m_st_DueTime, &m_ft_DueTime);

// Copy m_ft_DueTime into a LARGE_INTEGER structure
LARGE_INTEGER m_lg_DueTime;
m_lg_DueTime.LowPart = m_ft_DueTime.dwLowDateTime;
m_lg_DueTime.HighPart = m_ft_DueTime.dwHighDateTime;

// Set the next timer
if(!::SetWaitableTimer(handles[command_timer], &m_lg_DueTime,0, NULL, NULL, 0)) {
// Set timer failed, handle the error
DEBUG_LOG("CSleeperThread::run(): set waitable timer failed.");
}

// suspend until the timer expires
::WaitForMultipleObjects(2, handles, FALSE, INFINITE);


Mike Ellertson
GeneralRe: SetWaitableTimer Pin
Mike Dimmick18-Jan-04 23:39
Mike Dimmick18-Jan-04 23:39 
GeneralRe: SetWaitableTimer Pin
Mikey_E19-Jan-04 10:17
professionalMikey_E19-Jan-04 10:17 
GeneralRe: CSleeperThread Pin
Clem8628-Mar-08 2:45
Clem8628-Mar-08 2:45 
QuestionCan My Window Receive Messages Pin
bitpusher18-Jan-04 9:40
bitpusher18-Jan-04 9:40 
Generalstructs Pin
[Anders]18-Jan-04 8:53
[Anders]18-Jan-04 8:53 
GeneralRe: structs Pin
markkuk18-Jan-04 10:18
markkuk18-Jan-04 10:18 
GeneralRe: structs Pin
[Anders]18-Jan-04 11:23
[Anders]18-Jan-04 11:23 
GeneralRe: structs Pin
Ian Darling18-Jan-04 11:30
Ian Darling18-Jan-04 11:30 
GeneralMessage Closed Pin
18-Jan-04 11:37
[Anders]18-Jan-04 11:37 
GeneralRe: structs Pin
Ian Darling18-Jan-04 12:43
Ian Darling18-Jan-04 12:43 
GeneralRe: structs Pin
Jörgen Sigvardsson18-Jan-04 11:20
Jörgen Sigvardsson18-Jan-04 11:20 
GeneralRe: structs Pin
[Anders]18-Jan-04 12:37
[Anders]18-Jan-04 12:37 
GeneralRe: structs Pin
Rickard Andersson2018-Jan-04 12:18
Rickard Andersson2018-Jan-04 12:18 
GeneralRe: structs Pin
David Crow19-Jan-04 3:01
David Crow19-Jan-04 3:01 
GeneralMaths libraries Pin
Alexander M.,18-Jan-04 8:28
Alexander M.,18-Jan-04 8:28 
GeneralVC++ / ODBC / CSV files : how to perform UDDATE and DELETE statements Pin
Qadddd18-Jan-04 6:43
Qadddd18-Jan-04 6:43 
GeneralRe: VC++ / ODBC / CSV files : how to perform UDDATE and DELETE statements Pin
David Crow19-Jan-04 3:04
David Crow19-Jan-04 3:04 

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.