Source Code & Toys

Here are several projects with complete C++ source code. Most of the projects use the NADTEC library of common classes which is in the nadtec folder. You will need to build the library first before you  can build any of the other code. If you are using Visual Studio as I do, you will see that most projects have the nadtec project as a dependency which means that the nadtec library is automatically linked with the project. If you are porting to Linux etc. you will need to do a bit more work.

All source file collections were created with WinZip 8.0 http://www.winzip.com

Email: nigel-t@msn.com

Disclaimer

I'm not much for legal jargon so I say this in as clear a way as possible and hope that you understand my intent: All of this code is provided "as is". None of it is suitable for inclusion into a production project. I do not warranty this code in any way. I can not provide any support beyond what you find in the zip files - which is pretty limited.

Most source code contains a copyright notice. You may reuse the code in any way you wish but the copyright notice must stay in the file.

Project Directory Structure

I always work with my projects in a common tree structure. Most of the projects here assume this structure and in some cases the project does file copying after the build step is complete. Here is an example of my directory tree:

c:\apps
    include
    lib
    bin
    nadtec
    project1
    project2

The include, lib and bin directories are initially empty. When the build the nadtec project it copies its public header files to ../include and creates its library file in ../lib. Most projects build the exe files in ../bin so if you build a whole lot of projects they all end up in /apps/bin in this example. 

Debug versions of libraries have a 'd' on the end. So the nadtec library builds nadtecd.lib for debug and nadtec.lib for release builds.

You will probably have to set Visual Studio up to look in /apps/include for header files before most of the projects will build.

Projects

Simple web server

This is the simplest web server I could write in C++ which will serve up web pages that allow tag substitution.
Derive a class from WebSvr and overload OnTag and you have a web server that allows you insert content in place of simple tags in the .htm source file that look like: [##tag1]

 

NADTEC library

This small library contains assorted base classes used by other projects. I am constantly adding to this library and altering the classes in it. There is no guarantee that any class required by one of the other projects is actually in here or that it works correctly. I will try to keep this library current. Let me know if you find things wrong.
6-May-2001    Added classes for directory walk, semaphore, SMTP, DNS and NNTP.

Davis Weather Center HTTP Server

This is a very simple HTTP web server I wrote so that I could see weather data from one of my web servers.

Enigma Cryptography Machine

I was reading "Enigma" by Robert Harris and decided it might be interesting to write a software version of one of the machines. This is a bit terse to use but it's fun to see how it worked.

NewsHound - An NNTP Client

6-May-2001     I got fed up with my copy of WinVN blowing up every time I tried to get the headers for a large newsgroup. So this Saturday when had had a big dump of snow, I thought I'd see how hard it would be to write a simple news client. Please read the readme.txt file for what it does etc.

Tracer - A Debugging Aid

I like to be able to trace the progress of multiple processes in one place while I'm debugging. I wrote a simple named pipe server that runs in a console window and some simple debug code to send message to that window. You'll see I created an STL stream object called tout and use it a lot in my source code. tout just sends the text to the named pipe that tracer creates. Obviously you could adapt this to send it anywhere.

3DPlus Library

This is a recent rebuild of the library that was included with my 3D Graphics book. It works with the most recent Visual C++ release.

WinPing

A Windows graphical ping utility that will scan through a Class-C network.

EMU A Java RISC Emulator

I wrote this to teach my son about assembly language programming. It's a graphical Java program that emulates a 16-bit RISC processor with a simple instruction set. The display shows register contents as binary lights and in hex. It also shows the memory in hex. A few sample applications are included. I built this with Borland JBuilder. You should be able to build it with the Sun JDK.

Synthesizer (no code)