VC++ 6 CoreTools emulator HOWTO. 1. Disclaimers This is not an official release of CoreTools for PC. It does not implement the full functionality of CoreTools. This HOWTO does not describe all details of creating a project and/or compiling code on VC++ 6. Some previous knowledge of this product is assumed. Read VC++ help files to familiarize yourself with that product. These instructions will not work for Borland. 2. Setting up a new project in VC++ 6. a. Start VC++ . From the menu choose File -> New... In the dialog box that appears select "Projects" and then "Win32 Console Application". Select the name for the project and its location (a directory in which the subdirectory for your project will be created). You need to make sure that "Create new workspace" is checked. Hit OK. In the next dialog box select "an empty project" and click Finish. That creates a new directory at the chosen location, with the project's name. There will be a .dsp and a .dsw files in that directory. b. Copy CoreTools emulator files into that directory (outside VC++). c. Add all these .h and .cpp files to the project. This can be done through the Project -> Add to Project -> Files... menu item, or by clicking the FileView tab of the left window, right-clicking the project name and choosing "Add Files to Project" from the pop-up menu. 3. Make sure the #include directives in your program file (the one with your main() ) bring in the right files. So far, the following are available: CHeaders.h -- ported by Prof. Rasala IOTools.h MathUtil.h Random.h IOTools.cpp -- actual C++ code for the headers Random.cpp Everything with prefix ct_ should be blamed on me alone: ct_windows.h -- substututes for SWindows.h ct_graphics.h -- substututes for Graphics.h ct_mouse.h -- substututes for Mouse.h ct_text.h -- substututes for Text.h ct_delay.h -- substututes for Delay.h ct_windows.cpp -- actual C++ code for the headers ct_graphics.cpp As usual, you need to #include the .h files in your code, and make sure the corresponding .cpp files have been added to your project. 4. Uncomment what needs to be uncommented, as indicated in the text. One problem you may encounter is that min and max are defined as a part of the standard environment on Macs but not on PCs (actually, they are, but in a different way, which interferes with CoreTools code, so I disabled them). I provide two macros that handle the problem. Alternatively, you can write your own functions like int max( int a, int b ){ if( a < b ) return b; else return a; } or, using the so-called arithmetic if "? : ", int max( int a, int b ){ return ( a < b ) ? b : a ; } -------------------------------------------------------------- With this, you should be all set. Compile and run your program. If you notice any bugs, let me know right away.