You are currently offline, waiting for your internet to reconnect

How to write Visual C++.NET, Visual C#, or Visual Basic.NET code to perform inter-process communications via named pipes

This article has been archived. It is offered "as is" and will no longer be updated.
This article describes an All-In-One Code Framework sample that is available for download. This code sample demonstrates how to write Visual C++.NET, Visual C#, or Visual Basic.NET code to perform inter-process communications via named pipes. 

Difficulty level

Download information

To download this code sample, click the following link:


Technical overview

Named pipes are a named, one-way or duplex pipe for communication between the pipe server and one or more pipe clients. In the sample package, you can find the code of a named pipe server end and a named pipe client end. The server end creates a pipe named "\\.\pipe\SamplePipe" to perform message-based communication. The pipe supports duplex connections, so both client and server can read from and write to the pipe. The security attributes of the pipe are customized to allow Authenticated Users read and write access to a pipe, and to allow the Administrators group full access to the pipe. When the pipe is connected by a client, the server attempts to read the client's message from the pipe, and write a response. The client end connects to the named pipe "\\.\pipe\SamplePipe" for message-based duplex communications with the server end. The client writes a message to the pipe and receives the response from the pipe server after the pipe is connected.

The named pipe client ends and server ends in the Visual C++, Visual C#, or Visual Basic .NET code sample packages are completely inter-operational.

Named pipe is a mechanism for one-way or bi-directional inter-process communication (IPC) between the pipe server and one or more pipe clients in the local machine or across the computers in the intranet.

For example, CSNamedPipeServer can serve as the server end of the named pipe to be connected by CppNamedPipeClient, CSNamedPipeClient and VBNamedPipeClient. CppNamedPipeClient is able to connect to CppNamedPipeServer, CSNamedPipeServer and VBNamedPipeServer.

For more information about how to create the sample application and how to deploy the sample application, see the Readme.txt file that is included in the download package.

Technology category

  • Interprocess Communications


This code sample contains the following programming languages:

LanguageClient-side Project NameServer-side Project Name
Visual C++.NETCppNamedPipeClientCppNamedPipeServer
Visual C#CSNamedPipeClientCSNamedPipeServer
Visual Basic.NETVBNamedPipeClientVBNamedPipeServer


  • This sample application was created by using Visual Studio 2008 with Service Pack 1 installed.


  • IPC, Named Pipe


What is All-In-One Code Framework?

All-In-One Code Framework shows most Microsoft development techniques by using code samples in different programming languages. Each example is carefully selected, composed, and documented to show one common code scenario. For more information about All-In-One Code Framework, visit the following Web site:

How to find more All-In-One Code Framework samples

To find more All-In-One Code Framework samples, you can simply click the following link:

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Article ID: 2060067 - Last Review: 12/12/2015 08:34:13 - Revision: 3.0

Microsoft Visual Studio 2008 Service Pack 1

  • kbnosurvey kbarchive kbcodefx kbinfo kbrapidpub kbnomt atdownload kbsurveynew KB2060067