Miscellaneous Tips
Checklist for Build Configurations
Table 3 – Build Configurations 
Type
Objective Grid build
MFC build
Compile Time Directives for resources*
Pre-processor definitions
Application:
 
 
 
 
 
Static
Static
Yes
 
 
Static
DLL
Yes
_AFXDLL
 
DLL
DLL
No
_AFXDLL, _GXDLL
 
DLL
Static
Not supported
Not supported
Custom Objective Grid Extension DLL:
 
 
 
 
 
Static
DLL
Yes
_AFXEXT
 
DLL
DLL
No
_AFXEXT, _GXEXT
Custom Objective Grid regular DLL:
 
 
 
 
 
Static
DLL
Yes
_AFXDLL
 
DLL
DLL
No
_AFXDLL, _GXDLL
* Include "grid\gxres.rc" in Compile-time directives.
You should always include "grid\gxresrc.h" in Read-only symbols so you can access the grid resources.
Custom macro definitions should be used in custom Objective Grid Extension DLL; these definitions are provided in the file CustExtDefs.h.
 
Add "_CUSTEXTDLL" to your C++ Preprocessor Definitions.
// Add "_AFXDLL" to your C++ Preprocessor Definitions.
// Make sure the project Configuration Type is set to "Dynamic Library (.dll)."
// Make sure the project Use of MFC is set to "MFC in a Shared Dll."
// For Debug, set the Code Generation Runtime Library to /MDd.
// For Release, set the Code Generation Runtime Library to /MD.
//
// Code:
// Include this header file in your project.
// Add "#define _CUSTEXTEXPORT_IMPL" to the top of stdafx.cpp.
Miscellaneous Configurations
*Application that links to a custom Objective Grid Extension DLL as well as the Objective Grid Extension DLL;
*Application that links to a custom Objective Grid Extension DLL as well as the Objective Grid static lib;
*Application that links to a custom Objective Grid Regular DLL as well as the Objective Grid Extension DLL;
*Application that links to a custom Objective Grid Regular DLL as well as the Objective Grid static lib;
The settings for all the above miscellaneous configurations can be resolved from the settings for the basic three types of configurations.
Take, for example, an application that links to a custom Objective Grid Extension DLL as well as the Objective Grid Extension DLL. Its settings are similar to an application that links to an Objective Grid Extension DLL: it should include _GXDLL in its preprocessor settings and should not include the resources in its compile time directives.
Objective Grid and VC++
Building and Using VC++ Libraries
The solution files required for building OG and the samples under all supported versions of VC++ are included in the appropriate directories as Grid<ver>.sln, where <ver> represents the VC++ version. After rebuilding the libraries, the applications linking to those libraries should also be recompiled in order for them to link and work properly.
Make Files and Building Directly with nmake
When you build the Stingray libraries in Visual Studio, Visual Studio invokes make files that ship with the product. For information on these underlying make files, and how to build the libraries by invoking nmake on these files directly, see “Building from the Command Line with nmake” in the Getting Started part.
This section also discusses the issue of building the libraries with 1-byte structure alignment rather than the default 8-byte structure alignment.
Known Issues in VC++ Unicode Libraries
*Unicode Libraries return read-only recordsets in database applications using ODBC if the default snapshot option is used to open the recordset.
The CRecordset class in VC++ does not return writable recordsets in Unicode. Because of this, even though ODBC grid libraries under Unicode display recordsets properly, the recordsets cannot be updated. When trying to update grids such as these, the following error may be displayed: "Error: Invalid Option/identifier".
As a workaround, CRecordset::dynaset or CRecordset::dynamic options should be used to open recordsets.
*Unicode is not supported in this version of the Excel read\write classes, so the option ExcelReadWrite must be unchecked in the Grid BuildWizard to allow building Grid libraries with Unicode.
Objective Grid AppWizard
All of the OG AppWizards under VC++ change the default charset to Unicode. The MFC Application Wizard under VC++ by default includes the manifest file that points the application to link to comctrl32.dll.
Objective Grid Designer Utility
The source for the Objective Grid Designer Utility is available under the StingrayInstallation\utils directory, and can be compiled with any of the supported compiler versions.
Setting Paths in Visual Studio
Stingray Studio solution and vcxproj files use Microsoft's Property Sheets to set these paths. 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.
Objective Grid and Windows Look and Feel
Objective Grid can take advantage of a number of Windows visual styles, including Windows Vista, Windows XP, Office 2003, and Windows Classic. The next section describes a general mechanism for enabling these styles.
Vista Look and Feel
The Vista Classic style feature allows your applications to take on a look and fill similar to Windows Vista Classic. This visual style is theme-enabled, and requires Windows Vista. The style applies to MFC-derived and Stingray custom controls.
Applications and samples enable a particular drawing style with the function call RWSetVisualStyle(). Using this function requires inclusion of the header file RWUXTheme.h, which is found in the <stingray-installdir>\RWUXTheme\Include directory. RWSetVisualStyle() should be placed in the application or sample’s main InitInstance() or InitDialog() function call. The call should look like this:
 
RWSetVisualStyle(RW_VISUALSTYLE_VISTACLASSIC);
The following styles are available through this call:
*RW_VISUALSTYLE_VISTACLASSIC.
*RW_VISUALSTYLE_DOTNET
*RW_VISUALSTYLE_OFFICE2003
*RW_VISUALSTYLE_WINDOWSCLASSIC
XP Look and Feel
On Windows XP, Objective Grid can take advantage of XP visual styles. All the samples in Objective Grid are by default visual styles-enabled. The visual style applied to controls depends on the Windows theme enabled in the system. You can use the same mechanism described in the previous section to enable the XP look and feel.
If the visual styles feature must be turned off (although the manifest file is still included as a resource), call
 
RWSetVisualStyle( RW_VISUALSTYLE_WINDOWSCLASSIC );RWSetThemeAppProperties(4);
in the InitInstance() of the application. This will ensure that the theme (even though active) is not applied to the application in question.
For details on how Objective Grid behaves differently under Windows XP, see “Objective Grid and Windows XP Visual Styles.”