Skip to content

Latest commit

 

History

History
87 lines (75 loc) · 2.08 KB

File metadata and controls

87 lines (75 loc) · 2.08 KB
title call_as | 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.call_as
dev_langs
C++
helpviewer_keywords
call_as attribute
ms.assetid a09d7f1f-353b-4870-9b45-f0284161695d
caps.latest.revision 10
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

call_as

Enables a local function to be mapped to a remote function so that when the remote function is called, the local function is invoked.

Syntax

  
      [ call_as(  
   function  
) ]  

Parameters

function
The local function that you want to be called when a remote function is invoked.

Remarks

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

Example

The following code shows how you can use call_as to map a nonremotable function (f1) to a remotable function (Remf1):

// cpp_attr_ref_call_as.cpp  
// compile with: /LD  
#include "unknwn.h"  
[module(name="MyLib")];  
[dual, uuid("00000000-0000-0000-0000-000000000001")]  
__interface IMInterface {  
   [local] HRESULT f1 ( int i );  
   [call_as(f1)] HRESULT Remf1 ( int i );   
};  

Requirements

Attribute Context

Applies to Interface method
Repeatable No
Required attributes None
Invalid attributes None

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

See Also

IDL Attributes
Method Attributes
local