Named Pipe Wrapper for Win32 Platforms

Environment: VC6/MFC , Win9X/WinME/NT40/W2k

Background

Using pipes is not too complicated on WindowsNT platforms, but on Win9X it4s not that easy because named pipes are not supported.

The wrapper

"cPipe" is a C++ wrapper class encapsulating named pipes, providing a simple interface to create named pipes and to perform read/write operations. In addition an application-defined callback function, which is called by the framework if data is available, can be specified on creation ( the server side of the sample demonstrates the usage of the callback function ).

"cPipe" contains the following public methods, fully documented within the source.

Method

Description

Create

Creates and registers the neccessary pipe(s).

Close

Closes the pipe(s).

ReadPipe

Performs read operation on the pipe.

WritePipe

Performs write operation on the pipe.

GetLastError

Returns the latest cPipe error code.

The sample

The sample provides two tiny applications to demonstrate IPC. For the server-side run "core.exe" and for the client-side run "client.exe". For demonstration the server side just mirrors the data sent by the client application. I tested the sample applications on the following platforms: Win98, NT 4.0, W2k.

Server

Client

Downloads

Download demo project - 40 Kb
Download source - 6 Kb

IT Offers

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Go Deeper

  • The penetration of virtual servers is approaching 50 percent in IT infrastructures, yet administrators are only backing up, on average, 68 …
  • This buyers guide provides independent research and test results to help you determine your endpoint protection requirements and identify …
  • When the economy is stable, a company's IT organization may view Finance as just one of many internal customers competing for attention. But …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds