Click here to Skip to main content
15,915,752 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: String Table of Resources Pin
prithaa2-Apr-09 21:55
prithaa2-Apr-09 21:55 
GeneralRe: String Table of Resources Pin
Niklas L2-Apr-09 23:25
Niklas L2-Apr-09 23:25 
GeneralRe: String Table of Resources Pin
prithaa5-Apr-09 17:26
prithaa5-Apr-09 17:26 
QuestionCallback Routine Not Getting Triggered Pin
ExtraLean2-Apr-09 21:03
ExtraLean2-Apr-09 21:03 
AnswerRe: Callback Routine Not Getting Triggered Pin
Stuart Dootson2-Apr-09 21:44
professionalStuart Dootson2-Apr-09 21:44 
Questionnamed pipe sample Pin
AshNis2-Apr-09 19:49
AshNis2-Apr-09 19:49 
AnswerRe: named pipe sample Pin
Cedric Moonen2-Apr-09 20:34
Cedric Moonen2-Apr-09 20:34 
AnswerRe: named pipe sample Pin
Iain Clarke, Warrior Programmer3-Apr-09 0:52
Iain Clarke, Warrior Programmer3-Apr-09 0:52 
As Cedric said, you've not really given us anything to help you with.

I did a named pipe application (accurately, two applications!) using named pipes, and I just followed the samples on MSDN in the documentation.

Both from MSDN:
Multithreaded Pipe Server[^]
Named Pipe Client[^]

Enjoy!

One problem I had was making a named pipe accessible across the network by any user.

DWORD	CNamedPipeServer::ServerThread ()
{
	// Set up security attributes so anyone can login.
	SECURITY_ATTRIBUTES sa;
	SECURITY_DESCRIPTOR	sd;

	if (!InitializeSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION))
		return 0; //MSG_PIPE_CREATE_FAILED;
	SetSecurityDescriptorDacl (&sd, TRUE, NULL, FALSE);

	sa.nLength = sizeof (sa);
	sa.bInheritHandle = FALSE;
	sa.lpSecurityDescriptor = &sd;
	BOOL	bLog = FALSE;

	// Create pipe
	char	pipename [512];
	lstrcpy (pipename, "\\\\.\\pipe\\");
	lstrcat (pipename, m_PipeName);

	m_hPipe = ::CreateNamedPipe (pipename,
		PIPE_ACCESS_DUPLEX | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_OVERLAPPED,
		PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,
		1, 0, 0, 100000, &sa);


You don't have to use overlapped I/O - but it fitted my application. Just note the sa and sd variables.

Good luck,


Iain.

In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!

QuestionSpace in EDIT BOX Pin
MsmVc2-Apr-09 19:45
MsmVc2-Apr-09 19:45 
AnswerRe: Space in EDIT BOX Pin
_AnsHUMAN_ 2-Apr-09 22:22
_AnsHUMAN_ 2-Apr-09 22:22 
GeneralRe: Space in EDIT BOX Pin
qihuanfengyun3-Apr-09 2:30
qihuanfengyun3-Apr-09 2:30 
AnswerRe: Space in EDIT BOX Pin
Niklas L2-Apr-09 23:16
Niklas L2-Apr-09 23:16 
QuestionReading from fstream in CString object Pin
Anuj Sharma2-Apr-09 18:53
Anuj Sharma2-Apr-09 18:53 
QuestionRe: Reading from fstream in CString object Pin
«_Superman_»2-Apr-09 19:05
professional«_Superman_»2-Apr-09 19:05 
AnswerRe: Reading from fstream in CString object Pin
Anuj Sharma2-Apr-09 19:24
Anuj Sharma2-Apr-09 19:24 
GeneralRe: Reading from fstream in CString object Pin
«_Superman_»2-Apr-09 19:30
professional«_Superman_»2-Apr-09 19:30 
GeneralRe: Reading from fstream in CString object Pin
Stuart Dootson2-Apr-09 21:24
professionalStuart Dootson2-Apr-09 21:24 
GeneralRe: Reading from fstream in CString object Pin
krmed3-Apr-09 0:47
krmed3-Apr-09 0:47 
QuestionPopupDailog steal the current focus Pin
S p k 5212-Apr-09 18:13
S p k 5212-Apr-09 18:13 
QuestionHow can I paste data to other windows (who ever is accepting) ? [modified] Pin
Yovav2-Apr-09 17:07
Yovav2-Apr-09 17:07 
AnswerRe: How can I paste data to other windows (who ever is accepting) ? Pin
Niklas L2-Apr-09 23:02
Niklas L2-Apr-09 23:02 
GeneralRe: How can I paste data to other windows (who ever is accepting) ? Pin
Yovav3-Apr-09 1:23
Yovav3-Apr-09 1:23 
QuestionRe: How can I paste data to other windows (who ever is accepting) ? Pin
David Crow3-Apr-09 3:15
David Crow3-Apr-09 3:15 
AnswerRe: How can I paste data to other windows (who ever is accepting) ? Pin
Iain Clarke, Warrior Programmer3-Apr-09 1:22
Iain Clarke, Warrior Programmer3-Apr-09 1:22 
GeneralRe: How can I paste data to other windows (who ever is accepting) ? Pin
Yovav3-Apr-09 1:35
Yovav3-Apr-09 1:35 

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.