Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Grid User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

4.1 Creating a Starter Application

This section discusses creating a simple application, using either the Objective Grid static libraries or the Objective Grid DLL.

4.1.1 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:

    to the Read-only symbols directives: section and the line:

    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:

    Also add the header files that are common to all Stingray Studio products:

  5. In the implementation of the InitInstance() method in your application class, you should add the line:

  6. If you are using Visual Studio 2010, you have to set paths in each project. Please refer to Section 2.7.4, "Microsoft Visual Studio 2010 Changes," in the Stingray Studio Getting Started Guide for information on how to add property sheet(s) with Stingray Studio paths.

  7. Compile and run the project.

4.1.2 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 Section 4.1.1, "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.)


    Alternatively, add the following to the file stdafx.h:

    #define _GXDLL

  4. Compile and run the project.

4.1.3 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

    to the Preprocessor definitions.

  5. Click OK.

  6. Do a Rebuild All for your application.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.