Click here to Skip to main content
15,885,546 members
Articles / Desktop Programming / ATL

An eXtensible Car Description format with ATL COM

Rate me:
Please Sign up or sign in to vote.
4.83/5 (6 votes)
27 Mar 2012CC (ASA 3U)12 min read 40.1K   834   28  
Introduces the XCD format that describes cars as collections grouped by Make and Year, and provides an API ported into a COM library to access the collections.
// XCD Library.
// Copyright � 2011 MSB LLC. All rights reserved.

#pragma once

#ifndef STRICT
#define STRICT
#endif

#include "targetver.h"

#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit

#include "resource.h"
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>

using namespace ATL;

extern BSTR g_bstrFFN;
#define MAX_LOADSTRING 100

// Definitions for collection props IDs.
#define XCD_COLLECTION_TITLE_ID      1
#define XCD_COLLECTION_COUNT_ID      10
#define XCD_COLLECTION_XCDVERSION_ID 5
//#define COLLECTION_CATEGORY_ID     4    // reserved

// Definitions for base IDs in XCD (pictures).
#define XCD_PICTURE_BASEID           101
#define XCD_PICTURETITLE_BASEID      201
#define XCD_PICTUREFILENAME_BASEID   301

// Definitions for base IDs in XCD (specifications).
#define XCD_YEAR_ID                  1000 // same for all cars in a collection
#define XCD_MAKE_ID                  1100 // same for all cars in a collection
#define XCD_MODEL_BASEID             1201
#define XCD_SUBMODEL_BASEID          1301
#define XCD_TYPE_BASEID              1401
#define XCD_PRICE_BASEID             1501
#define XCD_POWER_BASEID             1601
#define XCD_FUEL_BASEID              1701
#define XCD_LENGTH_BASEID            1801
#define XCD_WIDTH_BASEID             1901
#define XCD_HEIGTH_BASEID            2001
#define XCD_WEIGHT_BASEID            2101
#define XCD_CLEARANCE_BASEID         2201
#define XCD_COUNTRY_ID               2300 // same for all cars in a collection
#define XCD_TANKVOLUME_BASEID        2401

#define BASEID_ARRAY_SIZE   15

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 Creative Commons Attribution-Share Alike 3.0 Unported License


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions