Click here to Skip to main content
16,006,440 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Socket TIME_WAIT questions.. Pin
valikac25-Nov-02 8:58
valikac25-Nov-02 8:58 
GeneralRe: Socket TIME_WAIT questions.. Pin
RobJones25-Nov-02 9:59
RobJones25-Nov-02 9:59 
GeneralRe: Socket TIME_WAIT questions.. Pin
valikac25-Nov-02 10:57
valikac25-Nov-02 10:57 
GeneralRe: Socket TIME_WAIT questions.. Pin
RobJones25-Nov-02 11:03
RobJones25-Nov-02 11:03 
General,Thread and Mutex Pin
Anonymous25-Nov-02 7:45
Anonymous25-Nov-02 7:45 
GeneralRe: ,Thread and Mutex Pin
Scott H. Settlemier25-Nov-02 8:10
Scott H. Settlemier25-Nov-02 8:10 
GeneralRe: ,Thread and Mutex Pin
Ruca26-Nov-02 1:11
Ruca26-Nov-02 1:11 
GeneralRe: ,Thread and Mutex Pin
Scott H. Settlemier28-Nov-02 16:14
Scott H. Settlemier28-Nov-02 16:14 
Here's a code sample:

// these handles are created and passed out to whoever'll
// let the thread know when to work and when to quit

HANDLE hWorkToBeDone=CreateEvent(0,FALSE,FALSE,0); // resets on wait
HANDLE hTimeToQuit=CreateEvent(0,TRUE,FALSE,0); // once signalled, stays so

// Basic thread loop

HANDLE Waitables[]={hTimeToQuit,hWorkToBeDone};
for (DWORD W=~WAIT_OBJECT_0;W!=WAIT_OBJECT_0;)
{
	switch (W=WaitForMultipleObjects(2,Waitables,FALSE,INFINITE))
	{
	case WAIT_FAILED:
		// use GetLastError and handle this
		break;
	case WAIT_OBJECT_0: // It is time to quit
		break;
	case WAIT_OBJECT_0+1: // There is work to be done
		; // Do some work
		break;
	case WAIT_TIMEOUT: // impossible? we specified no timeout
	default: // there should be no other cases. (e.g. for abandoned mutexes)
		ASSERT(FALSE);
	}
}

General,Thread and Mutex Pin
Anonymous25-Nov-02 7:34
Anonymous25-Nov-02 7:34 
GeneralAnimation Control Pin
Brigg Thorp25-Nov-02 7:28
Brigg Thorp25-Nov-02 7:28 
GeneralRe: Animation Control Pin
Scott H. Settlemier25-Nov-02 10:16
Scott H. Settlemier25-Nov-02 10:16 
GeneralBasic MFC question Pin
will138325-Nov-02 5:54
will138325-Nov-02 5:54 
GeneralRe: Basic MFC question Pin
Rob Caldecott25-Nov-02 5:58
Rob Caldecott25-Nov-02 5:58 
GeneralRe: Basic MFC question Pin
Roman Fadeyev25-Nov-02 6:04
Roman Fadeyev25-Nov-02 6:04 
GeneralRe: Basic MFC question Pin
Stephane Rodriguez.25-Nov-02 6:39
Stephane Rodriguez.25-Nov-02 6:39 
GeneralRe: Basic MFC question Pin
Jeff Patterson26-Nov-02 3:26
Jeff Patterson26-Nov-02 3:26 
GeneralCFileDialog problem under win 98 Pin
lbc25-Nov-02 5:50
lbc25-Nov-02 5:50 
GeneralRe: CFileDialog problem under win 98 Pin
Rob Caldecott25-Nov-02 5:57
Rob Caldecott25-Nov-02 5:57 
GeneralRe: CFileDialog problem under win 98 Pin
lbc25-Nov-02 22:06
lbc25-Nov-02 22:06 
GeneralMDI Splitter problems Pin
Bjornarsen25-Nov-02 5:43
Bjornarsen25-Nov-02 5:43 
GeneralRe: MDI Splitter problems Pin
dima_t25-Nov-02 18:02
dima_t25-Nov-02 18:02 
GeneralRe: Sockets and Threads Pin
georgiek5025-Nov-02 5:34
georgiek5025-Nov-02 5:34 
GeneralProblem with CDialogBar e CTreeCtrl Pin
Anthiny B.25-Nov-02 5:06
sussAnthiny B.25-Nov-02 5:06 
GeneralRe: Problem with CDialogBar e CTreeCtrl Pin
Roman Fadeyev25-Nov-02 5:17
Roman Fadeyev25-Nov-02 5:17 
GeneralRe: Problem with CDialogBar e CTreeCtrl Pin
Anonymous25-Nov-02 5:32
Anonymous25-Nov-02 5:32 

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.