Skip to content

Latest commit

 

History

History
52 lines (39 loc) · 1.35 KB

library-block.md

File metadata and controls

52 lines (39 loc) · 1.35 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: library_block
library_block (C++ COM Attribute)
10/02/2018
vc-attr.library_block
library_block attribute
ae7a7ebe-5e1a-4eda-a058-11bbd058ece8

library_block

Places a construct inside the IDL library block.

Syntax

[library_block]

Remarks

When you place a construct inside the library block, you ensure that it will be passed into the type library, regardless of whether it is referenced. By default, only constructs modified by the coclass, dispinterface, and idl_module attributes are placed in the library block.

Example

In the following code, a custom interface is placed inside the library block.

// cpp_attr_ref_library_block.cpp
// compile with: /LD
#include <windows.h>
[module(name="MyLib")];
[object, library_block, uuid("9E66A290-4365-11D2-A997-00C04FA37DDB")]
__interface IMyInterface {
   HRESULT f1();
};

Requirements

Attribute context Value
Applies to Anywhere
Repeatable No
Required attributes None
Invalid attributes None

For more information, see Attribute Contexts.

See also

Compiler Attributes
Stand-Alone Attributes