object (C++)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

Identifies a custom interface.

  
[object]  
  

When preceding an interface definition, the object C++ attribute causes the interface to be placed in the .idl file as a custom interface.

Any interface marked with object must inherit from IUnknown. This condition is satisfied if any of the base interfaces inherit from IUnknown. If no base interfaces inherit from IUnknown, the compiler will cause the interface marked with object to derive from IUnknown.

See nonbrowsable for an example of how to use object.

Attribute Context

Applies tointerface
RepeatableNo
Required attributesNone
Invalid attributesNone

For more information about the attribute contexts, see Attribute Contexts.

IDL Attributes
Interface Attributes
dual
dispinterface
custom
__interface
Attributes Samples

Show: