Sun Jan 10 13:51:50 EST 2010
To add virtual window capability to your project, copy the vwindow.h and vwindow.cpp from the Figure6RT project into your project folder. Then, in Visual C++ 2008, choose Add existing item from the Project menu. ... Or just start with that project.
Add #include "vwindow.h" to your project's .cpp or .h file.
Call VWCreate in your WM_CREATE case.
Call VWWMPaint in your WM_PAINT.
For all other cases, when you need to paint, use VWDC() as your HDC value, then call VWPaint to refresh the screen (i.e., to trigger a WM_PAINT event.)
The following #include's must be added to stdafx.h to allow for joystick and save file capability:
mmsystem.h — for JoySetPos and the JOYINFO structure (see Screen Shot 1 for details)
commdlg.h — for GetSaveFileName and the OPENFILENAME structure. (see Screen Shot 2 for details)
stdio.h — for the fopen, fprintf, fclose functions and the FILE type. (see Screen Shot 3 for details)
math.h — for the log function.
Add the winmm.lib library to the Linker Command Line, so that joystick functions are linked in to your executable. (see Screen Shot 4 for details)
The ensure that your project will build on all Windows platforms, change the following configuration properties:
Set the character set to Not Set so that the compiler doesn't try to use Unicode or other multi-byte characters. (see Screen Shot 5 for details)
Turn on the manifest FAT32 workaround so that the project builds on FAT32 as well as NTFS filesystems. (see Screen Shot 6 for details)
A convenient way to declare local variables in the case is to use a block (defined by curly braces). Use comments as well. (see Screen Shot 7 for details)
Download the executable (programmed by Ian Anderson, a student from the 2008 Winter term): EXE [517,632 bytes] or zipped EXE [168,728 bytes]
An example of a graph that the program produced...
see Screen Shot 8An example of a file that the program saved... text [1,592 bytes] or zipped text [530 bytes]
Lab 3 Marking Scheme
[PDF; 14,601 bytes]
Lab 3 instructions | Back to CTEC1638 | Technology Courses | Technology at Niagara College