Click here to Skip to main content
15,903,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: page fault Pin
Hamid_RT10-Jan-08 19:59
Hamid_RT10-Jan-08 19:59 
GeneralRe: page fault Pin
George_George10-Jan-08 20:02
George_George10-Jan-08 20:02 
GeneralRe: page fault Pin
Hamid_RT10-Jan-08 20:49
Hamid_RT10-Jan-08 20:49 
GeneralRe: page fault Pin
George_George10-Jan-08 20:50
George_George10-Jan-08 20:50 
GeneralRe: page fault Pin
Hamid_RT10-Jan-08 21:10
Hamid_RT10-Jan-08 21:10 
GeneralRe: page fault Pin
David Crow10-Jan-08 2:43
David Crow10-Jan-08 2:43 
GeneralRe: page fault Pin
George_George10-Jan-08 2:53
George_George10-Jan-08 2:53 
Generalproblem with named pipes Pin
vasu_ever9-Jan-08 18:56
professionalvasu_ever9-Jan-08 18:56 
i have to read a file in remote system. so i am using named pipes for communication. In local system i can get handle to named pipe, but when i try to connect to remote system, i get invalid handle value.


	HANDLE hPipe; <br />
	LPTSTR lpvMessage=TEXT("Hi... hru ... message from client"); <br />
	TCHAR chBuf[BUFSIZE]; <br />
	BOOL fSuccess; <br />
	DWORD cbRead, cbWritten, dwMode; <br />
	LPTSTR lpszPipename = TEXT("\\\\servername\\pipe\\mynamedpipe"); <br />
<br />
	// Try to open a named pipe; wait for it, if necessary. <br />
	SECURITY_ATTRIBUTES saAttr; <br />
<br />
	// Set the bInheritHandle flag so pipe handles are inherited. <br />
<br />
	saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); <br />
	saAttr.bInheritHandle = TRUE; <br />
	saAttr.lpSecurityDescriptor = NULL; <br />
<br />
	<br />
	while (1) <br />
	{ <br />
		hPipe = CreateFile( <br />
			lpszPipename,   // pipe name <br />
			GENERIC_READ |  // read and write access <br />
			GENERIC_WRITE, <br />
			0,              // no sharing <br />
			NULL,           // default security attributes<br />
			OPEN_EXISTING,  // opens existing pipe <br />
			0,        // default attributes <br />
			NULL);          // no template file <br />
<br />
		// Break if the pipe handle is valid. <br />
<br />
		if (hPipe != INVALID_HANDLE_VALUE) <br />
			break; <br />
<br />
		// Exit if an error other than ERROR_PIPE_BUSY occurs. <br />
<br />
		if (GetLastError() != ERROR_PIPE_BUSY) <br />
		{<br />
			printf("Could not open pipe"); <br />
			return;<br />
		}<br />
<br />
		// All pipe instances are busy, so wait for 20 seconds. <br />
<br />
		if (!WaitNamedPipe(lpszPipename, 20000)) <br />
		{ <br />
			printf("Could not open pipe"); <br />
			return ;<br />
		} <br />
	} <br />
<br />
	// The pipe connected; change to message-read mode. <br />
<br />
	dwMode = PIPE_READMODE_MESSAGE; <br />
	fSuccess = SetNamedPipeHandleState( <br />
		hPipe,    // pipe handle <br />
		&dwMode,  // new pipe mode <br />
		NULL,     // don't set maximum bytes <br />
		NULL);    // don't set maximum time <br />
	if (!fSuccess) <br />
	{<br />
		printf("SetNamedPipeHandleState failed"); <br />
		return ;<br />
	}<br />
<br />
	// Send a message to the pipe server. <br />
<br />
	fSuccess = WriteFile( <br />
		hPipe,                  // pipe handle <br />
		lpvMessage,             // message <br />
		(lstrlen(lpvMessage)+1)*sizeof(TCHAR), // message length <br />
		&cbWritten,             // bytes written <br />
		NULL);                  // not overlapped <br />
	if (!fSuccess) <br />
	{<br />
		printf("WriteFile failed"); <br />
		return  ;<br />
	}<br />


this is my problem .. if u have any idea ... pls give me answer asap... Smile | :)
GeneralRe: problem with named pipes Pin
Member 75496010-Jan-08 4:05
Member 75496010-Jan-08 4:05 
GeneralDialog creation in win32 dll failed [modified] Pin
narayanagvs9-Jan-08 18:54
narayanagvs9-Jan-08 18:54 
GeneralRe: Dialog creation in win32 dll failed Pin
Hamid_RT9-Jan-08 19:03
Hamid_RT9-Jan-08 19:03 
GeneralRe: Dialog creation in win32 dll failed Pin
narayanagvs9-Jan-08 20:23
narayanagvs9-Jan-08 20:23 
QuestionCStringArray variable to CString variable Pin
ciiiek9-Jan-08 16:56
ciiiek9-Jan-08 16:56 
GeneralRe: CStringArray variable to CString variable Pin
Nishad S9-Jan-08 18:48
Nishad S9-Jan-08 18:48 
GeneralRe: CStringArray variable to CString variable Pin
Hamid_RT9-Jan-08 19:27
Hamid_RT9-Jan-08 19:27 
GeneralRe: CStringArray variable to CString variable Pin
Rajesh R Subramanian9-Jan-08 21:19
professionalRajesh R Subramanian9-Jan-08 21:19 
QuestionWhy DROPEFFECT_NONE doesn't work when type is CF_HDROP ? Pin
faulfish9-Jan-08 16:05
faulfish9-Jan-08 16:05 
GeneralDLL's and functions/varaibles Pin
ForNow9-Jan-08 15:51
ForNow9-Jan-08 15:51 
GeneralRe: DLL's and functions/varaibles Pin
Naveen9-Jan-08 16:20
Naveen9-Jan-08 16:20 
GeneralRe: DLL's and functions/varaibles Pin
ForNow9-Jan-08 16:25
ForNow9-Jan-08 16:25 
GeneralRe: DLL's and functions/varaibles Pin
Naveen9-Jan-08 16:39
Naveen9-Jan-08 16:39 
GeneralRe: DLL's and functions/varaibles Pin
ForNow9-Jan-08 17:20
ForNow9-Jan-08 17:20 
GeneralRe: DLL's and functions/varaibles Pin
Naveen9-Jan-08 17:24
Naveen9-Jan-08 17:24 
GeneralRe: DLL's and functions/varaibles Pin
ForNow9-Jan-08 17:27
ForNow9-Jan-08 17:27 
GeneralRe: DLL's and functions/varaibles Pin
CPallini9-Jan-08 20:56
mveCPallini9-Jan-08 20:56 

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.