WAV by Mihailo Despotovic, May 1998

A small Windows program in C++ that shows any file as a wave: open a file and choose Start Drawing, and it reads 100 bytes spread through the file and draws them as a line, each byte's value its height. I wrote it while learning MFC and Visual C++ 5.0 in haste, before emigrating to the USA for my first job there. The window below runs it as it was; the menus, the toolbar and the dialogs are the ones it had, and you can resize the window. The Open dialog has a few files to try, or you can pick one of your own; nothing leaves your computer.

Untitled - WAV

The bugs, and the fixes

Fixed reads 100 bytes spread evenly through the file, draws them all across the whole window with larger values higher, and says so when a file is empty. My 32×32 icon, the wave, is in the About box; the title bar shows the 16×16 icon, which was still AppWizard's MFC one, as it was. The port was checked against the original C++, compiled with small stand-ins for MFC: in 206 sessions of opening, drawing and resizing, with files from 0 to a million bytes, it draws the same lines and crashes in the same places.

The original C++ code (the parts I wrote, marked ********; the rest is from AppWizard)