Skip to content

Latest commit

 

History

History
105 lines (90 loc) · 2.24 KB

File metadata and controls

105 lines (90 loc) · 2.24 KB
title dual | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
vc-attr.dual
dev_langs
C++
helpviewer_keywords
dual attribute
ms.assetid 5d4a9069-d819-42cd-ba56-bbcda17157d9
caps.latest.revision 9
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

dual

Places an interface in the .idl file as a dual interface.

Syntax

  
[dual]  
  

Remarks

When the dual C++ attribute precedes an interface, it causes the interface to be placed inside the library block in the generated .idl file.

Example

The following code is an attribute block that uses dual before an interface definition:

// cpp_attr_ref_dual.cpp  
// compile with: /LD  
#include <windows.h>  
[module(name="MyLibrary")];  
  
[uuid("2F5F63F1-16DA-11d2-9E7B-00C04FB926DA"), dual]  
  
__interface IStatic : IDispatch   
{  
   HRESULT Func1(int i);  
   [   propget,   
      id(1),   
      bindable,   
      displaybind,   
      defaultbind,   
      requestedit  
   ]   
   HRESULT P1([out, retval] long *nSize);  
   [   propput,   
      id(1),   
      bindable,   
      displaybind,   
      defaultbind,   
      requestedit  
   ]   
   HRESULT P1([in] long nSize);      
};  
  
[cpp_quote("#include file.h")];  

Requirements

Attribute Context

Applies to interface
Repeatable No
Required attributes None
Invalid attributes dispinterface

For more information, see Attribute Contexts.

See Also

IDL Attributes
Attributes by Usage
custom
dispinterface
object
__interface