Click here to Skip to main content
15,885,104 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionOutlook Addins Question Pin
None_li15-Apr-14 15:50
None_li15-Apr-14 15:50 
QuestionCStaic SetWindowText() blinking problem [Solved] Pin
econy14-Apr-14 6:55
econy14-Apr-14 6:55 
QuestionRe: CStaic SetWindowText() blinking problem Pin
David Crow14-Apr-14 9:04
David Crow14-Apr-14 9:04 
AnswerRe: CStaic SetWindowText() blinking problem Pin
econy14-Apr-14 9:21
econy14-Apr-14 9:21 
GeneralRe: CStaic SetWindowText() blinking problem Pin
CPallini14-Apr-14 9:44
mveCPallini14-Apr-14 9:44 
GeneralRe: CStaic SetWindowText() blinking problem Pin
econy15-Apr-14 4:54
econy15-Apr-14 4:54 
GeneralRe: CStaic SetWindowText() blinking problem Pin
CPallini15-Apr-14 6:10
mveCPallini15-Apr-14 6:10 
QuestionWaitForMultipleObjects keeps catching timeout event (RESOLVED) Pin
bkelly1313-Apr-14 11:36
bkelly1313-Apr-14 11:36 
Windows 7, 64 bit, Visual Studio 2012, MFC, C++

Summary: The app starts a new thread and waits on multiple events from the main to do something. The wait specifies no timeout. At this point, the main has not created any events. Within the thread the case statement shows a timeout is always present. I tried resetting the time out event but get the error code invalid handle.

What did I do wrong to cause the timeout event and what must be changed to stop it.

Details: The following is phrases extracted from the thread code:

const BOOL  WAIT_FOR_ANY_EVENT      = FALSE;
const BOOL  WAIT_FOR_ALL_EVENTS     = TRUE;
const DWORD       WAIT_TIMEOUT_VALUE = 5000;
const DWORD       NO_TIMEOUT         =    0;
...
event_detected = WaitForMultipleObjects(
      EVENT_ARRAY_SIZE,
      mp_common_data->event_array,
      WAIT_FOR_ANY_EVENT,
      NO_TIMEOUT );
...
switch( event_detected )
{
     case WAIT_TIMEOUT:  // defined in winerror.h, value = 258L
     {
      mp_common_data->count_of_timeout_events ++;
      BOOL reset_status = ResetEvent( (HANDLE ) WAIT_TIMEOUT );
      if( reset_status == FALSE )
           {
           m_wsa_error = GetLastError();  // error = 6, invalid handle
            }
             ...
	break;
}
...
}

Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com



modified 13-Apr-14 19:58pm.

AnswerRe: WaitForMultipleObjects keeps catching timeout event Pin
SoMad13-Apr-14 12:28
professionalSoMad13-Apr-14 12:28 
GeneralRe: WaitForMultipleObjects keeps catching timeout event Pin
bkelly1313-Apr-14 14:03
bkelly1313-Apr-14 14:03 
GeneralRe: WaitForMultipleObjects keeps catching timeout event Pin
SoMad13-Apr-14 14:13
professionalSoMad13-Apr-14 14:13 
QuestionLinking errors Pin
tre412-Apr-14 11:51
tre412-Apr-14 11:51 
AnswerRe: Linking errors Pin
Richard Andrew x6412-Apr-14 15:07
professionalRichard Andrew x6412-Apr-14 15:07 
GeneralRe: Linking errors Pin
tre412-Apr-14 22:18
tre412-Apr-14 22:18 
QuestionProgram keeps looping [Solved] Pin
CounterClockWise11-Apr-14 14:13
CounterClockWise11-Apr-14 14:13 
AnswerRe: Program keeps looping Pin
Richard Andrew x6411-Apr-14 16:26
professionalRichard Andrew x6411-Apr-14 16:26 
GeneralRe: Program keeps looping Pin
CounterClockWise11-Apr-14 16:41
CounterClockWise11-Apr-14 16:41 
QuestionDraw two monitors syncron Pin
_Flaviu10-Apr-14 22:11
_Flaviu10-Apr-14 22:11 
AnswerRe: Draw two monitors syncron Pin
Richard MacCutchan10-Apr-14 22:41
mveRichard MacCutchan10-Apr-14 22:41 
AnswerRe: Draw two monitors syncron Pin
pasztorpisti11-Apr-14 6:17
pasztorpisti11-Apr-14 6:17 
GeneralRe: Draw two monitors syncron Pin
_Flaviu13-Apr-14 22:23
_Flaviu13-Apr-14 22:23 
Question[MFC Desktop Application for enumerating Virtual customized folder and files] Windows 8 Address Bar icon problem Pin
Nirmal K P10-Apr-14 19:39
Nirmal K P10-Apr-14 19:39 
QuestionUse PlaySound api caused memory loading? Pin
cedricvictor10-Apr-14 16:02
cedricvictor10-Apr-14 16:02 
AnswerRe: Use PlaySound api caused memory loading? Pin
Richard Andrew x6410-Apr-14 17:19
professionalRichard Andrew x6410-Apr-14 17:19 
QuestionMS Word Automation - I get so far - now what? Pin
Bryan Anslow10-Apr-14 9:43
Bryan Anslow10-Apr-14 9:43 

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.