Click here to Skip to main content
15,895,709 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.3K   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.

import "oaidl.idl";
import "ocidl.idl";

[
	object,
	uuid(D2446F3D-7BB1-45ED-AEAA-F9BDF129DC84),
	dual,
	nonextensible,
	helpstring("ICollection Interface"),
	pointer_default(unique)
]
interface ICollection : IDispatch{
    [propput, id(1), helpstring("property FFN")] HRESULT FFN([in] BSTR bstrFFN);
	[id(2), helpstring("method GetTitle")] HRESULT GetTitle([out,retval] BSTR* pbstrTitle);
	[id(3), helpstring("method GetCount")] HRESULT GetCount([out,retval] USHORT* pnCount);
	[id(4), helpstring("method GetVersion")] HRESULT GetVersion([out,retval] BSTR* pbstrCollectionVersion);
	[id(5), helpstring("method GetXCDVersion")] HRESULT GetXCDVersion([out,retval] BSTR* pbstrXCDVersion);
	[id(6), helpstring("method IsCarFile")] HRESULT IsCarFile([out,retval] VARIANT_BOOL* pbCarFile);
};
[
	object,
	uuid(EDD794CF-E10B-4EBC-970B-6EA2271DCDC1),
	dual,
	nonextensible,
	helpstring("ICar Interface"),
	pointer_default(unique)
]
interface ICar : IDispatch{
	[id(1), helpstring("method GetPictureTitle")]  HRESULT GetPictureTitle([in] USHORT nItem, [out,retval] BSTR* pbstrTitle);
	[id(2), helpstring("method GetPicture")] HRESULT GetPicture([in] USHORT nItem, [out,retval] IPicture** ppPicture);
	[id(3), helpstring("method GetValue")] HRESULT GetValue([in] USHORT nItem, [in] BSTR bstrTag, [out,retval] BSTR* bstrValue);
	[id(4), helpstring("method GetData")] HRESULT GetData([in] USHORT nItem, [out,retval] VARIANT* pData);
};
[
	uuid(6A8C8129-79F2-41CE-8785-3F5F29AB9C98),
	version(1.0),
	helpstring("XCD 1.0 Type Library")
]
library XCD
{
	importlib("stdole2.tlb");
	[
		uuid(CD7586A4-FFC5-4278-ADEE-E86D8E3D1E93),
		helpstring("Collection Class")
	]
	coclass Collection
	{
		[default] interface ICollection;
	};
	[
		uuid(D73146D1-A157-47BF-ACD8-1B1BC372658A),
		helpstring("Car Class")
	]
	coclass Car
	{
		[default] interface ICar;
	};
};

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