Click here to Skip to main content
15,885,113 members
Articles / Desktop Programming / MFC

The SBJ MVC Framework - The Model, from Abstraction to Realization

Rate me:
Please Sign up or sign in to vote.
5.00/5 (19 votes)
20 Mar 2009CPOL19 min read 109.2K   1.3K   51  
A Model-View-Controller Framework that integrates with the MFC Doc/View architecture
#include "MasterBuildNumbers.h"

#ifdef _DEBUG
#define BUILD_CONFIG " Win32 Debug\0"
#define CFG_SUFFIX "D"
#else
#define BUILD_CONFIG " Win32 Release\0"
#define CFG_SUFFIX ""
#endif


////////////////////////////////////////////////////////////////////////////////
// Required Macros

#ifndef FILE_NAME
#error("Must provide FILE_NAME macro")
#endif

#ifndef FILE_VERSION_NO
#error("Must provide FILE_VERSION_NO macro")
#endif

#ifndef FILE_VERSION
#error("Must provide FILE_VERSION macro")
#endif


////////////////////////////////////////////////////////////////////////////////
// Optional Macro Defaults

#ifndef PRODUCT_VERSION_NO
#define PRODUCT_VERSION_NO FILE_VERSION_NO
#endif

#ifndef PRODUCT_VERSION
#define PRODUCT_VERSION FILE_VERSION
#endif

#ifndef COMPANY_NAME
#define COMPANY_NAME "\0"
#endif

#ifndef LEGAL_COPYRIGHT
#define LEGAL_COPYRIGHT "Copyright � 2008 " COMPANY_NAME "\0"
#endif

#ifndef LEGAL_TRADEMARK
#define LEGAL_TRADEMARK
#endif

#ifndef FILE_DESC
#define FILE_DESC
#endif

#ifndef COMMENTS
#define COMMENTS FILE_DESC
#endif

#ifndef INTERNAL_NAME
#define INTERNAL_NAME FILE_NAME
#endif

#ifndef PRODUCT_NAME
#define PRODUCT_NAME FILE_NAME MAJOR_VERSION_STR VC_VERSION_STR CFG_SUFFIX ".DLL"
#endif

#ifndef SPECIAL_BUILD
#define SPECIAL_BUILD BUILD_CONFIG
#endif


// Composite description macro
#define FILE_DESCRIPTION FILE_DESC BUILD_CONFIG "\0"

/////////////////////////////////////////////////////////////////////////////
// Version

VS_VERSION_INFO VERSIONINFO
 FILEVERSION FILE_VERSION_NO
 PRODUCTVERSION PRODUCT_VERSION_NO
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE VFT_APP
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", COMMENTS
            VALUE "CompanyName", COMPANY_NAME
            VALUE "FileDescription", FILE_DESCRIPTION
            VALUE "FileVersion", FILE_VERSION
            VALUE "InternalName", INTERNAL_NAME
            VALUE "LegalCopyright", LEGAL_COPYRIGHT
            VALUE "LegalTrademarks", LEGAL_TRADEMARK
            VALUE "OriginalFilename", FILE_NAME
            VALUE "ProductName", PRODUCT_NAME
            VALUE "ProductVersion", PRODUCT_VERSION
            VALUE "SpecialBuild", SPECIAL_BUILD
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409,1200
    END
END

// clear defines
#undef FILE_NAME
#undef FILE_DESC
#undef COMMENTS
#undef INTERNAL_NAME
#undef PRODUCT_NAME
#undef SPECIAL_BUILD
#undef FILE_VERSION_NO
#undef FILE_VERSION
#undef PRODUCT_VERSION_NO
#undef PRODUCT_VERSION
#undef COMPANY_NAME
#undef LEGAL_COPYRIGHT
#undef LEGAL_TRADEMARK
#undef FILE_DESCRIPTION


//*** Modification History ***
// $Log:  $

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
SBJ
United States United States
Real name is Steve Johnson. Programming since 1979. Started on a Heathkit Micro with a DEC LSI-11 and UCSD Pascal. Moved to PCs & DOS as soon as Turbo Pascal became available. Did some Assembly, ISR, TSR etc. All this while working for a Manufacturing Co. for 8 years. Had my own solo Co. doing barcode labeling software for 4 years (terrible business man, all I wanted to do was code). Since then working for various software companies. Moved to Windows around the time of 3.1 with Borland C then C++. Then on to VC++ and MFC, and just about anything I could get my hands on or had to learn for my job, and been at it ever since. Of course recently I've been playing with .NET, ASP, C#, WPF etc.

Comments and Discussions