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

Indicates that the type information member is the default member for display in the user interface.


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

The following code shows a sample of uidefault:

// cpp_attr_ref_uidefault.cpp  
// compile with: /LD  
#include "unknwn.h"  
[object, uuid("9E66A290-4365-11D2-A997-00C04FA37DDB")]  
__interface ICustom{  
   HRESULT Custom([in] long l, [out, retval] long *pLong);  
   [uidefault]HRESULT id0([in] long l);  
   [uidefault]HRESULT id1([in] long l);  
   [uidefault, propget] HRESULT get_y(int *y);  
   [uidefault, propput] HRESULT put_y(int y);  

Attribute Context

Applies toInterface method
Required attributesNone
Invalid attributesNone

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

IDL Attributes
Method Attributes
Attributes Samples