Difference between revisions of "Tutorial Project. Release 13"

From wiki.visual-prolog.com

m
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{spbCopyright}}
{{PolylineTemplateEn
|goal= The demonstration of practices of the Vip-based programming:
|goalContent=
*The ways of the communication of the main applicaion with the parts of the application, which are placed to the DLL (Dynamically Linked Library);
*The practice of the rising and handling the exceptions.
|code=
*'''The set of projects'''. The Release 13 contains the set strongly dependent projects - the project of the main application and projects of three DLLs, where DLL has  the special project to build it. The set of projects contains:
**The Project ModelsDLL (generates the DLL), where models of the computer strategies of the game Computer0, Computer1, Computer2 are placed.
**The Project Computer3DLL (generates the DLL), where the model of the strategy Computer3 is placed.
**The Project HumanInterfaceDLL (generates the DLL), where classes related to the HumanInterface are placed. This DLL is called using the library, which used while the main application building.
**Project ObjectWin - the project of the main executable application.
|functionality=
*New strategy model Computer3 added.
|install=
If you have '''VipSpbSDK''', then you will find all projects in the directory '''Examples\Polyline\Polyline13\Programs'''


The Release 13 is the next iteration of the Tutorial Project, where the functional idea is the easy game (Polyline).
{{PolylineInstall}}


[[PolyLine Game Rules|Game Rules ...]]
|open=
==Purpose==
==Building==
The purpose of the Release 13 is to demonstrate the implementation of the different ways of the communication of the main application with the parts of the application, which are placed to the DLL (Dynamically Linked Library). The same time we demonstrate the practice of the rising and handling of exceptions.
[[Polyline Version Reference|'''Please, see first your version specialty''']]
==The specialities of the Release 13==
===The set of projects===
The Release 13 contains the set strongly dependent projects - the project of the main application and projects of three DLLs, where DLL has  the special project to build it.


The set of projects contains:  
Open and build projects:
*The Project ModelsDLL (generates the DLL), where models of the computer strategies of the game Computer0, Computer1, Computer2 are placed.
*The Project Computer3DLL (generates the DLL), where the model of the strategy Computer3 is placed (the project included to the only commercial release; in the noncommercial version the only DLL presents).
*The Project HumanInterfaceDLL (generates the DLL), where classes related to the HumanInterface are placed (included to the commercial release only; in the noncommercial version the only DLL presents). This DLL is called using the library, which used while the main application building.
*Project ObjectWin - the project of the main executable application.


===The same functionality===
*Programs\Computer3Dll\Computer3Dll.prj6;
The behavior of applications of the Release 13 is the same as the behavior of applications of the Release 11, 12. The only difference is the DLL-related violations exceptions reacting.
*Programs\HumanInterfaceDll\HumanInterfaceDLL.prj6;
==Download and Install==
*Programs\ModelsDll\ModelsDll.prj6. The warning while the compilation points to the incorrect declaration. It is done to demonstrate the reaction on the exception in the DLL;
To install and run the set of projects of the Release 13:
*Programs\ObjectWin\Polyline13_ObjWindows.prj6.
*Download archives
**'''PdcSpbSDK_13_Classes.zip'''
**'''PdcSpbSDK_72_PE_Examples_Polyline13_Programs.zip''',
using the PDC forum page [http://discuss.visual-prolog.com/viewtopic.php?p=31296&sid=b2208e8e3ec2a4480bffd4e7ecc61290#31296 VIP-Tools and Examples]
*Extract archives listed above to the same directory. You should have in mind, that each of the archives creates the structure of the folders with the root PdcSpbSDK. Repetitions are possible. The result the structure of the Release 13 should look like:
[[Image:Polyline13Structure.jpg]]


==Run==
{{PolylineBuildCMD}}
Open, build and run (using Visual Prolog 7.2 (VIP 7.2)):
 
*Programs/ModelsDLL/ModelsDLL.prj. The warning while the compilation of the projects, points to the invalid declaration created specially. This invalid declaration demonstrates the handling of the error in the DLL while the execution of the application.
|run=
*Programs/Computer3DLL/Computer3DLL.prj (only in the commercial version)
*The application corresponding to the project Programs\ObjectWin\Polyline13_ObjWindows.prj6 must be invoked;
*Programs/HumanInterfaceDLL/HumanInterfaceDLL.prj (only in the commercial version)
{{PolylineRun7_X}}
*Programs/ObjectWin/Polyline13_ObjWindows.prj
|rusver=
To build projects the IDE variable SpbSolutions must be set to the PdcSpbSDK directory.
The language of the application, if supported, may be defined in the command line by the language identifier:
*en - English
*ru - Russian
[[ru:Учебный Проект. Релиз 13]]
[[ru:Учебный Проект. Релиз 13]]
 
}}
==Reference==
[[Category:Tutorial Project Evolutions]]

Latest revision as of 16:54, 10 April 2011

Written by Victor Yukhtenko. Email: victor@pdc.spb.su

The programs listed below are part of the Evolutions Tutorial Project article.

Game Rules ...

Goal

The demonstration of practices of the Vip-based programming:

  • The ways of the communication of the main applicaion with the parts of the application, which are placed to the DLL (Dynamically Linked Library);
  • The practice of the rising and handling the exceptions.

Functionality

  • New strategy model Computer3 added.

Code

  • Tested with Visual Prolog 7.3 build 7302.
  • The set of projects. The Release 13 contains the set strongly dependent projects - the project of the main application and projects of three DLLs, where DLL has the special project to build it. The set of projects contains:
    • The Project ModelsDLL (generates the DLL), where models of the computer strategies of the game Computer0, Computer1, Computer2 are placed.
    • The Project Computer3DLL (generates the DLL), where the model of the strategy Computer3 is placed.
    • The Project HumanInterfaceDLL (generates the DLL), where classes related to the HumanInterface are placed. This DLL is called using the library, which used while the main application building.
    • Project ObjectWin - the project of the main executable application.

Install

If you have VipSpbSDK, then you will find all projects in the directory Examples\Polyline\Polyline13\Programs

To get the full set of projects of the series of the Polyline projects, please download archives using links at PDC forum:

  • VipSpbSDK_PE_73_Examples_Polyline_1_14.zip
  • VipSpbSDK_PE_73_Tools_Polyline_1_14.zip]

to any convenient directory. The directory named VipSpbSDK will be created automatically.

Building

Please, see first your version specialty

Open and build projects:

  • Programs\Computer3Dll\Computer3Dll.prj6;
  • Programs\HumanInterfaceDll\HumanInterfaceDLL.prj6;
  • Programs\ModelsDll\ModelsDll.prj6. The warning while the compilation points to the incorrect declaration. It is done to demonstrate the reaction on the exception in the DLL;
  • Programs\ObjectWin\Polyline13_ObjWindows.prj6.

To build projects the IDE variable SpbSolutions must be set to the VipSpbSDK directory.

The complex building

To simplify the settings and initial building of applicaions the Build.cmd command file included (BuildPersonal.cmd - please see details in Polyline Version Reference or in Examples\Polyline\VersionReference.html).

The use of Build.cmd file:

  • sets the SpbSolutions IDE variable, which refers to the VipSpb SDK directory;
  • "knows" where Visual Prolog is installed and uses VipBuilder.exe;
  • builds all projects containing in the subfolders;
  • builds all needed libraries;
  • registers all pzl-Components (if needed);
  • informs regarding the result of each building operation;
  • Build.cmd file may be used together with the Visual Prolog CE only (please see details in Polyline Version Reference or in Examples\Polyline\VersionReference.html).

Run

  • The application corresponding to the project Programs\ObjectWin\Polyline13_ObjWindows.prj6 must be invoked;
  • Run the application using the E of the IDE or run the executable at the directory EXE.
  • The language of the application may be defined in the command line by the language identifier:
    • en - English
    • ru - Russian
  • When running the program from the IDE, the parameter of the language must be placed to the field "Project Settings"\Run Options\Run Arguments, available from menu Project\Settings...