Click here to Skip to main content
15,886,137 members
Articles / Desktop Programming / ATL

Small ATL Tricks: Part One

Rate me:
Please Sign up or sign in to vote.
4.74/5 (15 votes)
1 Oct 20025 min read 118.4K   1.3K   50  
This series of articles demonstrates how to use some of the cool features of ATL in a time and energy saving manner.
// ErrorDispatch.idl : IDL source for ErrorDispatch.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (ErrorDispatch.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";
	[
		object,
		uuid(82BE5480-9585-4CCD-9798-F27190766D45),
		dual,
		helpstring("IFoo Interface"),
		pointer_default(unique)
	]
	interface IFoo : IDispatch
	{
		[id(1), helpstring("Generates an error displaying the string provided")] HRESULT GenerateError(BSTR Message);
	};

[
	uuid(88DD580C-FDE6-4F43-8B81-72E95C061F37),
	version(1.0),
	helpstring("ErrorDispatch Demonstration Library")
]
library ERRORDISPATCHLib
{
	importlib("stdole32.tlb");
	importlib("stdole2.tlb");

	[
		uuid(77D24643-1922-4C42-A7C3-FBBDDA71559C),
		helpstring("Foo Class")
	]
	coclass Foo
	{
		[default] interface IFoo;
	};
};

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
India India
Ashutosh Arya is an Electrical Engineer. He is currently working for Softcrylic Inc.

Comments and Discussions