SimpleCPPClient: a C++ console-mode example

Top  Previous  Next

About SimpleCPPClient

 

This is a task so simple as to be useless behaviourally – it extends a lever, records up to ten lever-presses, times out after a minute and stores the response times. Nevertheless, it illustrates communication with the server, controlling outputs, responding to timers and input devices, and data output in a comma-delimited format suitable for importing directly into a database. Furthermore, it is one of the easiest kinds of client to write in C++, because it doesn't really need any Windows graphical user interface programming. You can run the task from the Start menu.

 

When running, it looks like this:

 

SimpleCPPClient

 

The source code is provided in the SimpleCPPClient directory. If you want to open projects ('workspaces') in Visual C++, double-click on the *.dsw files (in this case, SimpleCPPClient.dsw). The process of writing such an application is documented in the following files:

 

Building this program – quickly!.txt
Building this program – from scratch, in detail.txt

 

It would be easy to copy this application and modify it to perform a more useful task. As this is meant to be a programming exercise, I'll leave the rest to you.