[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.9.16 Creating an External MSVC 7 Application

Written by Philip Wyett philipwyett@dsl.pipex.com. Last updated 2 June 2003.

This HOWTO is a step by step guide for creating a basic Crystal Space application with MSVC 7 .NET outside the Crystal Space source tree.

IMPORTANT: This tutorial assumes you have a basic familiarity with MSVC and it's inner workings. This tutorial also assumes you have a fully compiled (both release and debug) version of Crystal Space somewhere on your computer.

Step 1 - Creating a basic project solution.

Start MSVC 7 and from the File menu click on File then New and once the sub menu of New opens, click on Project. You will now be presented with a dialog box (see image below) for creating a new project.

tutorial/howto/msvc7proj/snap0

Firstly we need to select the type of project we wish to create. Crystal Space applications are Win32 applications and primarily work from a console base. This still allows the creation of Graphical User Interface (GUI) applications. However, it also allows you to use the -console command line switch and access more verbose runtime data normally only available with debug builds. If you do wish to create standard win32 applications, you may do so. However... the -console switch will not operate correctly in that type of application.

In the Project Types: window select Visual C++ projects. Next we move to the Templates: window and choose the application type we wish to create. As mentioned above Crystal Space applications are Win32 applications. So, search that window and select Win32 Project. Now enter the name of your application in the Name text box. In our example, the application will be named `simple1'. Once done, click on the OK button.

You will now be presented with another dialog box (see image below).

tutorial/howto/msvc7proj/snap1

We wish to specify some application settings. So, click on hyperlink text Application Settings below Overview and you will be presented with what can be seen in the screenshot below.

tutorial/howto/msvc7proj/snap2

As discussed above, Crystal Space applications are primarily console based (though GUI are allowed) inorder to give us acces to the verbose diagnostic text via -console. Under Application type:, select Console application. We are starting from a blank canvas. So, in the Additional options: section, check the box Empty project. Once done, click on the Finish button.

You should now be in the MSVC 7 IDE (Intergrated Development Environment), with the simple1 project loaded. Lets move on...

Step 2 - Adding files/code to the project solution.

Rather than create code for this tutorial and keeping inline with time honored tradition - We are now going to cheat and use existing Crystal Space code. :-)

Firstly copy and paste the `simple1.cpp' and `simple1.h' from the Crystal Space code tree, into the newly created `simple1' project directory. These files can be found here:

`CS\apps\tutorial\simple1\'

Once done, return to the MSVC IDE and select the Solution Explorer tab within the Solution Explorer window. See the image below to see the Solution Explorer window from within the MSVC IDE.

tutorial/howto/msvc7proj/snap3

To add file(s) to a project, select the appropriate folder in the Solution Explorer window, be that Source Files or Header Files etc. Right click on it to bring up the context menu and then hover over Add until the sub menu appears and then click on Add Existing Item.... You will now be presented with the Add Existing Item dialog box, which can be seen in the image below.

tutorial/howto/msvc7proj/snap4

After selecting the desired file(s) you wish to add, click on the Open button to finalize your choice(s) and be returned back to the MSVC IDE. Repeat this process twice adding `simple1.cpp' to the Source Files folder and `simple1.h' to the Header Files folder. Once done you should have a Solution Explorer window which looks like the image below.

tutorial/howto/msvc7proj/snap5

Step 3 - Setting Crystal Space PATHS inside MSVC.

tutorial/howto/msvc7proj/snap6

tutorial/howto/msvc7proj/snap7

tutorial/howto/msvc7proj/snap8

tutorial/howto/msvc7proj/snap9

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html