Getting Started : Chapter 5 Support for the MFC Feature Pack : Migration Essentials
Migration Essentials
Existing customers who have established applications built with Stingray Studio version 10.1 or earlier are not required to migrate. Migrating to the FoundationEx library is optional. Existing applications will continue to work as they previously did. Customers should migrate to the FoundationEx library only if they wish to use Stingray Studio in conjunction with any new features provided in the MFC Feature Pack, such as the RibbonBar.
Migration Prerequisites
Microsoft Visual Studio 2008 with Service Pack 1 or later installed
The features that the FoundationEx library is built upon are included with the Microsoft Visual Studio 2008 compiler when Service Pack 1 or later compilers are installed.
Stingray Studio 10.2 or later must be installed
The FoundationEx library was included in Stingray Studio 10.2 as a preview. Upgrades have been made with each successive versions. Please review this product’s Readme.html file for details.
Migration Requirements
File Paths
The files for the FoundationEx library are located in the following structure within the Stingray Studio installation directory:
Include:
<StingrayInstallDir>\Include\FoundationEx
Resource:
<StingrayInstallDir>\Include\Res
Library:
<StingrayInstallDir>\Lib\vc9\[x86|x64]
Source:
<StingrayInstallDir>\Src
<StingrayInstallDir>\Src\FoundationEx
Samples:
<StingrayInstallDir>\Samples\FoundationEx
The solution file is FoundationEx90.sln:
<StingrayInstallDir>\Src
The libraries, located in:
<StingrayInstallDir>\Lib\vc9\[x86|x64]
File Naming
The libraries are named similarly to the following where [Version] is the current version:
Stingray Lib MFC Lib Release: sflex[Version].lib
Stingray Lib MFC DLL Release: sflex[Version]a.lib
Stingray Lib MFC DLL Debug: sflex[Version]ad.lib
Stingray DLL MFC DLL Release: sflex[Version]as.dll
Stingray DLL MFC DLL Debug: sflex[Version]asd.dll
Stingray DLL MFC DLL Unicode Release: sflex[Version]asu.dll
Stingray DLL MFC DLL Unicode Debug: sflex[Version]asud.dll
Stingray Lib MFC DLL Unicode Release: sflex[Version]au.lib
Stingray Lib MFC DLL Unicode Debug: sflex[Version]aud.lib
Stingray Lib MFC Lib Debug: sflex[Version]d.lib
Stingray Lib MFC Lib Unicode Release: sflex[Version]u.lib
Stingray Lib MFC Lib Unicode Debug: sflex[Version]ud.lib
Refer to the FoundationEx.h section for information on how these static and dynamic libraries are linked to an application.
Header File Changes
SupportedPlatforms.h
Stingray Studio includes a file called SupportedPlatforms.h that determines whether the items you are building are supported or not. Include SupportedPlatforms.h in the application’s stdafx.h header file. The file is located in the <StingrayInstallDir>\Include directory.
NOTE >> This should replace any targetver.h files that are generated by an application wizard.
ManifestDefs.h
Stingray Studio includes a file called ManifestDefs.h that facilitates proper generation of manifest files in the application. Include ManifestDefs.h in the application’s stdafx.h header file. The file is located in the <StingrayInstallDir>\Include directory. This should replace any MFC, CRT, or Windows Common Control manifest definitions.
FoundationEx.h
To have access to the functionality in the FoundationEx library, include FoundationEx.h to your application’s stdafx.h file below any necessary Windows include files. The FoundationEx.h header file is located in the <StingrayInstallDir>\Include\FoundationEx directory. This file includes the necessary header files for other functionality in the library, as well as the necessary defines for linking to the libraries.
 
#include “FoundationEx\FoundationEx.h”
NOTE >> The above assumes you have your IDE correctly pathed for Stingray Studio. Refer to the Getting Started Users Guide for more details on paths.
NOTE >> If you get compiler errors related to definitions of INT16, make sure you include FoundationEx.h before other Stingray product header files.
SFLResEx.h and SFLResEx.rc.
To have access to the functionality of FoundationEx resources, such as menu ID’s and default toolbar images, include SFLResEx.h in your application. The SFLResEx.h header file is located in the <StingrayInstallDir>\Include\Res directory. To add the header files to a sample or application, open the Resource View and right click on the sample or application’s .rc file and select ‘Resource Includes’.
1. Add SFLResEx.h to the includes section:
#include “FoundationEx\Res\SFLResEx.h”
2. Add SFLResEx.rc to the resource section below the include section:
#include “FoundationEx\Res\SFLResEx.rc”
AfxRibbon.rc
For some Stingray configurations, you may need to add afxribbon.rc to your resource includes to avoid any errors when compiling. Adding afxribbon.rc to your application may cause conflicts with some LIB Release configurations. To add the file, open the Resource View, right click on your project .rc resource file and select ‘Resource Includes’. Then add the following to the bottom section.
 
#include “afxribbon.rc”
If this is not added, the sample or application will crash on statically linked build configurations.
NOTE >> Conflicts may exist between SFLResEx.rc and afxribbon.rc. If so, try adding or removing any sections containing afxribbon.rc.
The _SFLEXDLL Preprocessor Macros
Include _SFLEXDLL in the preprocessor macros if you want to link FoundationEx as a Dynamic Link Library. Include _SFLEXDLL in the C++ preprocessor settings or define _SFLEXDLL in your stdafx.h header file before including any other Stingray Studio headers.
 
#ifndef _SFLEXDLL
#define _SFLEXDLL
#endif