Click here to Skip to main content
15,914,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Knowing Insert/Overwrite is on/off Pin
V.6-Jul-04 3:42
professionalV.6-Jul-04 3:42 
GeneralRe: Knowing Insert/Overwrite is on/off Pin
David Crow6-Jul-04 4:43
David Crow6-Jul-04 4:43 
GeneralRe: Knowing Insert/Overwrite is on/off Pin
0v3rloader6-Jul-04 5:06
0v3rloader6-Jul-04 5:06 
GeneralRe: Knowing Insert/Overwrite is on/off Pin
David Crow6-Jul-04 7:15
David Crow6-Jul-04 7:15 
GeneralRe: Knowing Insert/Overwrite is on/off Pin
0v3rloader6-Jul-04 7:48
0v3rloader6-Jul-04 7:48 
GeneralRe: Knowing Insert/Overwrite is on/off Pin
David Crow6-Jul-04 8:04
David Crow6-Jul-04 8:04 
GeneralRe: problems with forcibly closing the .exe Pin
#realJSOP6-Jul-04 3:19
professional#realJSOP6-Jul-04 3:19 
Generalblocking pipe write Pin
A T I F6-Jul-04 2:37
A T I F6-Jul-04 2:37 
I am trying to have a overlapped blocking pipe write so that I can have either data sent signal or a timeout signal... The code I have written is as follows

<br />
	DWORD dwMode = PIPE_READMODE_MESSAGE | PIPE_WAIT;<br />
	BOOL bSuccess = ::SetNamedPipeHandleState(m_hPipe, &dwMode, NULL, NULL);<br />


and my pipe write function have code
<br />
	OVERLAPPED op = {0};<br />
	op.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);<br />
<br />
	bSuccess = ::WriteFile(m_hPipe, lpBufferPos, dwToWrite,<br />
								&dwNumberOfBytesWritten, &op);<br />
		<br />
		if(bSuccess)<br />
		{<br />
                      return TRUE;<br />
		}<br />
		else<br />
		{<br />
			m_dwLastError = ::GetLastError();<br />
			if(m_dwLastError == ERROR_IO_PENDING)<br />
			{<br />
				switch(WaitForSingleObject(op.hEvent, m_dwTimeOut))<br />
				{<br />
				case WAIT_OBJECT_0:<br />
					return TRUE;<br />
					break;<br />
				case WAIT_TIMEOUT:<br />
					m_dwLastError = ::GetLastError();<br />
					return FALSE;<br />
				case WAIT_FAILED:<br />
					m_dwLastError = ::GetLastError();<br />
					return FALSE;<br />
					break;<br />
				}<br />
			}<br />
			else<br />
			{<br />
                                return FALSE;<br />
			}<br />
		}  <br />
	}<br />

The problem that I am facing is that all my Write to pipe function calls keeps returning with TRUE code and the corresponding first Read call in the child process remains locked at the WaitForSingleObject call and then after some write pipe operation in the parent process Read returns with "More data is available" error.

Can anyone direct me what I am doing wrong.
GeneralRe: blocking pipe write Pin
A T I F6-Jul-04 2:43
A T I F6-Jul-04 2:43 
GeneralThread synchronization Pin
Kamis6-Jul-04 2:32
Kamis6-Jul-04 2:32 
GeneralRe: Thread synchronization Pin
Antony M Kancidrowski6-Jul-04 3:43
Antony M Kancidrowski6-Jul-04 3:43 
GeneralRe: Thread synchronization Pin
Kamis6-Jul-04 8:30
Kamis6-Jul-04 8:30 
GeneralRe: Thread synchronization Pin
Antony M Kancidrowski6-Jul-04 10:34
Antony M Kancidrowski6-Jul-04 10:34 
Generaloperator new with function free() Pin
xcavin6-Jul-04 0:48
xcavin6-Jul-04 0:48 
GeneralRe: operator new with function free() Pin
Michael P Butler6-Jul-04 0:53
Michael P Butler6-Jul-04 0:53 
GeneralRe: operator new with function free() Pin
xcavin6-Jul-04 1:19
xcavin6-Jul-04 1:19 
GeneralRe: operator new with function free() Pin
Antony M Kancidrowski6-Jul-04 3:34
Antony M Kancidrowski6-Jul-04 3:34 
QuestionQuestion about quering INF file keys? Pin
Behzad Ebrahimi6-Jul-04 0:46
Behzad Ebrahimi6-Jul-04 0:46 
GeneralAccessing a variable from another class Pin
sugumar6-Jul-04 0:43
sugumar6-Jul-04 0:43 
GeneralRe: Accessing a variable from another class Pin
Michael P Butler6-Jul-04 1:04
Michael P Butler6-Jul-04 1:04 
GeneralRe: Accessing a variable from another class Pin
sugumar6-Jul-04 1:20
sugumar6-Jul-04 1:20 
GeneralRe: delete and free Pin
#realJSOP6-Jul-04 0:13
professional#realJSOP6-Jul-04 0:13 
GeneralRe: delete and free Pin
Roger Stoltz6-Jul-04 0:56
Roger Stoltz6-Jul-04 0:56 
GeneralRe: delete and free Pin
xcavin6-Jul-04 1:25
xcavin6-Jul-04 1:25 
GeneralHelp from VB programmers Pin
#realJSOP5-Jul-04 23:34
professional#realJSOP5-Jul-04 23:34 

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.