Objective Grid : PART I User’s Guide : Chapter 4 Getting Started
Chapter 4 Getting Started
Creating a Starter Application
This section discusses creating a simple application, using either the Objective Grid static libraries or the Objective Grid DLL.
Using the Objective Grid Static Libraries
The following steps describe how to build a starter application using the Objective Grid static libraries:
1. Create a new MFC Application MDI project with AppWizard. You may choose to use the MFC library As a shared DLL or As a statically linked library.
2. Include the resources needed for the grid component. To do this, select Resource View from the View menu. Right-click the root of the resource tree and choose Resource Includes… from the pop-up menu. Add the line:
#include "grid\gxresrc.h"
to the Read-only symbols directives: section and the line:
#include "grid\gxres.rc"
to the Compile-time directives: section. A message box warns that "Directive text will be written verbatim into your resource script and may render it uncompilable." You can safely click OK.
3. Open the declaration (.h) and implementation (.cpp) files for the view class. Change the derivation for the view class to CGXGridView. All references to CView should be replaced by CGXGridView. The OnBeginPrinting(), OnEndPrinting(), OnPreparePrinting() and OnDraw() member functions created by AppWizard should either be removed from your view class or you should insert a call to the associated CGXGridView version of this method.
4. In the stdafx.h file, you should add the line:
 
#include <grid\gxall.h>
Also add the header files that are common to all Stingray Studio products:
Add #include <SupportedPlatforms.h> toward the top of the file.
Add #include <ManifestDefs.h> below the other #include statements in this file.
5. In the implementation of the InitInstance() method in your application class, you should add the line:
GXInit();
6. If you are using Visual Studio 2010, you have to set paths in each project. Please refer to “Stingray Studio Paths in Property Sheets” in the Getting Started part for information on how to add property sheet(s) with Stingray Studio paths.
7. Compile and run the project.
Using the Objective Grid Extension DLLs
The following steps describe how to build a starter application using the Objective Grid Extension DLL:
1. Create a new MFC Application MDI project with AppWizard. You must choose to use the MFC library As a shared DLL.
2. Perform Steps 2 through 5 from “Using the Objective Grid Static Libraries.”
3. In the configuration settings, add the preprocessor directive _GXDLL to your solution’s C++ compiler settings. (Make sure you add it to all configurations.)
NOTE >> Alternatively, add the following to the file stdafx.h:

#define _GXDLL
4. Compile and run the project.
Converting an Application to Use the Objective Grid Extension DLL
If you are using the internal makefile with most of the standard defaults, you can easily change the project to build the DLL version. Here are the steps:
1. Open your project in Visual Studio.
2. Open the Configuration Settings dialog box by selecting Project Properties|Settings…
3. On the General tab, select Use MFC in a Shared DLL from the Microsoft Foundation Classes combo box.
4. On the C/C++ tab, add
_GXDLL
to the Preprocessor definitions.
5. Click OK.
6. Do a Rebuild All for your application.