Programming on ViSaGe with Visual C++ 2010 Express
How to Configure the Directory of the Header File and
the Library
Yasuharu Okamoto
Japan Women’s University
If you want to Develop a windows form application in Visual C++ 2012/CLR, visit this website.
If you want information about configuring directories and libraries in Japanese, visit this website.
When writing programs with Visual C++ 2010 Express to control a ViSaGe, you have to set directories and to add the library of ViSaGe for each project. I show a example of programming with Visual C++ 2010 Express in the following, which has five sections, 1. Creating a new project; 2. Setting directories; 3. Adding the ViSaGe library; 4. Writing codes; 5. Running your program.
1. Creating a new project.
Select the menu “File|New|Project” (Figure 1).

Figure 1
Visual C++ displays a New Project dialog box (Figure 2).

Figure 2
Select a Location, and set a project name. Click the OK button, then Visual C++ displays a dialog box shown in Figure 3.

Figure 3
Click the Next button, then Visual C++ displays a dialog box shown in Figure 4

Figure 4
Click the Finish button, then Visual C++ displays a Code Editor window (Figure 5).

Figure 5
At this point, you can set directories.
2. Setting directories.
Select the menu “Project|Properties” (Figure 6).

Figure 6
Visual C++ displays a Property Pages dialog box (Figure 7)

Figure 7
Click + sign at the head of “Configuration Properties”, then Visual C++ displays information as shown in Figure 8. When the + sign is not shown, double click on “Configulation Properties”.

Figure 8
Click “VC++ Directories”, then Visual C++ displays configuration of directories (Figure 9).

Figure 9
Click “Include Directories” row, then a button with “v” sign appears (Figure 10).

Figure 10
Click this “v” sign, then Visual C++ displays an edit box (Figure 11).

Figure 11
Click the edit box, then Visual C++ displays a Include Directories dialog box (Figure 12).

Figure 12
Click the New Line button, then the dialog box displays a white rectangular area surrounded by dotted lines with a button on the right end. (Figure 13).

Figure 13
Click the button shown in Figure 13, then Visual C++ displays a Select Directory dialog box (Figure 14).

Figure 14
Select the appropriate directory, which is “C:\Program Files\Cambridge Research systems\VSGV8\Windows\Win32\MSVC\INCLUDE” on our PC (Figure 15).

Figure 15
Click the OK button, then Visual C++ displays the Property Pages dialog box as shown in Figure 16.

Figure 16
Repeat the above setting for Source Directories, then you see the following dialog box as shown in Figure 17

Figure 17
Then click the 適用(A) button, then you go back to the Code Editor window shown in Figure 5.
3. Adding the ViSaGe library.
Now, you add the ViSaGe library, which include vsg functions, which will be linked to in building the project. Select the menu “Project|Add Existing Item…” (Figure 18),

Figure 18
Visual C++ displays a Add Existing Item dialog box (Figure 19). Add the VSG library “C:\Program Files\Cambridge Research systems\VSGV8\Windows\Win32\MSVC\LIB\VSGV8.LIB”, which is the library in the case of our ViSaGe,

Figure 19
Click the Add button, Visual C++ displays the Code Editor window (Figure 5).
4. Writing codes.
Add codes to the program in the Code Editor window shown in Figure 5, so that the program becomes the following.
#include "stdafx.h"
#include <VSGV8.h>
int _tmain(int argc, _TCHAR* argv[])
{
::vsgInit("");
int h = ::vsgGetScreenHeightPixels();
::vsgSetDrawPage(vsgVIDEOPAGE, 0, 0);
::VSGTRIVAL c;
c.a = 1.0;
c.b = 1.0;
c.c = 0.0;
::vsgPaletteSet(1, 1, &c);
::vsgSetPen1(1);
::vsgDrawRect(0, 0, h/2, h/2);
::vsgSetDisplayPage(0);
return 0;
}
5. Running your program.
After writing the above codes, select the menu “Debug|Build Solution”, then “Debug|Start Debugging” if you build successfully your project. Your ViSaGe system will display a yellow square on the display.
When you want to make an image file using Visual C++ and to display it on ViSaGe system, you can do. The explanation is prepared at this website in Japanese.