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 |
Close |
Closes |
ReadPipe |
Performs |
WritePipe |
Performs |
GetLastError |
Returns |
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