ATL Attributes

Microsoft Visual C++ supplies as a standard component an attribute provider DLL, named ATLPROV.DLL, which defines and supports a set of C++ attributes specifically to help with ATL Programming. To enable ATL attributes in source code, a small preparation is necessary, since the compiler must be told that ATLPROV is wanted. The built-in provider attribute is the means, but explicit use of it in a block such as

    provider (name = ATL4, uuid = "BC6B4B8A-0E4A-4BC9-B319-9DC2ACFB61EE")

is not ordinarily seen by programmers (and indeed, Microsoft does not otherwise document that the provider attribute even exists). Instead, programmers simply define _ATL_ATTRIBUTES ahead of including ATLBASE.H, and leave the ATL headers to handle the detail.

The following are all the attributes implemented by the ATL Attribute Provider (ATLPROV) in Microsoft Visual C++ version 7.00.9466. Only one is missing from the product documentation’s Attributes Alphabetical Reference. It is highlighted yellow. Note however that it is not a shipping attribute.

ATLPROV also affects the behaviour of the following built-in attributes:

The alternative documentation attempted of each attribute begins with the attribute’s formal syntax in terms of Attribute Provider Provider (ProvProv) attributes. This definition is what the compiler relies on to enforce the main points of the attribute’s syntax. It is surely very similar to what Microsoft must have in its own ATLPROV source code, and the wonder is how the product documentation can so often beg to differ, e.g., on such matters as whether an attribute is repeatable.

The formal syntax may be followed by notes on additional syntactic requirements implemented within ATLPROV. If it is not so followed, it does not (yet) mean that ATLPROV imposes no additional syntax: it just means I have not yet written it up. The plan for the distant future is to follow all this with notes on what the attribute causes to be injected as source code.