Click here to Skip to main content
14,207,870 members

C / C++ / MFC

 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023723-Mar-15 5:12
memberMember 935023723-Mar-15 5:12 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt23-Mar-15 5:57
mveJochen Arndt23-Mar-15 5:57 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023723-Mar-15 6:20
memberMember 935023723-Mar-15 6:20 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt23-Mar-15 6:44
mveJochen Arndt23-Mar-15 6:44 
GeneralRe: Writing Vector object into a .txt file Pin
Richard Andrew x6423-Mar-15 8:39
professionalRichard Andrew x6423-Mar-15 8:39 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt23-Mar-15 21:53
mveJochen Arndt23-Mar-15 21:53 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023723-Mar-15 23:47
memberMember 935023723-Mar-15 23:47 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt24-Mar-15 0:17
mveJochen Arndt24-Mar-15 0:17 
Just call Sleep() with a time out value of 1000 / frequency[Hz].

A better implememntation would use WaitForSingleObject() with the same time out value and a handle to a terminate thread event so that you can terminate the thread:

UINT worker_thread_func(LPVOID pParam)
{
    // pParam is usually a pointer to a C++ class to which this thread belongs
    //  that is passed when creating the thread.
    // Cast the pointer to get access to member vars.
    MyClass *pThis = (MyClass *)pParam;
    HANDLE hKillEvent = pThis->m_hKillEvent;
    while (1)
    {
        if (WAIT_OBJECT_0 == WaitForSingleObject(hKillEvent, TIME_OUT_VAL))
            break;
        // Perform periodic task here
    }
    return 0;
}

GeneralRe: Writing Vector object into a .txt file Pin
Member 935023725-Mar-15 4:25
memberMember 935023725-Mar-15 4:25 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt25-Mar-15 4:46
mveJochen Arndt25-Mar-15 4:46 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt25-Mar-15 6:56
mveJochen Arndt25-Mar-15 6:56 
QuestionBIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus16-Mar-15 11:24
memberTacitonitus16-Mar-15 11:24 
AnswerRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C16-Mar-15 13:00
memberFrankie-C16-Mar-15 13:00 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus16-Mar-15 15:36
memberTacitonitus16-Mar-15 15:36 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C16-Mar-15 22:39
memberFrankie-C16-Mar-15 22:39 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus17-Mar-15 3:34
memberTacitonitus17-Mar-15 3:34 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 4:11
memberFrankie-C17-Mar-15 4:11 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Tacitonitus17-Mar-15 7:21
memberTacitonitus17-Mar-15 7:21 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 7:29
memberFrankie-C17-Mar-15 7:29 
GeneralRe: BIG trouble with 64-bit Shell_NotifyIcon() - can anyone help? Pin
Frankie-C17-Mar-15 22:48
memberFrankie-C17-Mar-15 22:48 
QuestionVC++ DLL throws error when call it from C#[EntryPointNotFound] Pin
Member 988367216-Mar-15 1:38
memberMember 988367216-Mar-15 1:38 
AnswerRe: VC++ DLL throws error when call it from C#[EntryPointNotFound] Pin
Richard Andrew x6416-Mar-15 5:48
professionalRichard Andrew x6416-Mar-15 5:48 
QuestionIAccessible - get word under mouse pointer in IE Pin
Fourblack15-Mar-15 22:01
memberFourblack15-Mar-15 22:01 
QuestionC++ to C problem Pin
alexx00614-Mar-15 10:03
memberalexx00614-Mar-15 10:03 
AnswerRe: C++ to C problem Pin
Richard Andrew x6414-Mar-15 13:15
professionalRichard Andrew x6414-Mar-15 13:15 

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.


Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190612.1 | Last Updated 16 Jun 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid