For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Identifies an interface as an Object Description Language (ODL) interface. The MIDL compiler does not require the odl attribute; it is recognized only for compatibility with older .odl files.


The odl C++ attribute has the same functionality as the odl MIDL attribute.

// cpp_attr_ref_odl.cpp  
// compile with: /LD  
#include <unknwn.h>  
[odl, oleautomation, dual, uuid("00000000-0000-0000-0000-000000000001")]  
__interface IMyInterface  
   HRESULT x();  
[coclass, uuid("00000000-0000-0000-0000-000000000002")]  
class cmyClass : public IMyInterface  
   HRESULT x(){}  

Attribute Context

Applies tointerface
Required attributesNone
Invalid attributesNone

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

IDL Attributes
Interface Attributes
Attributes Samples