Skip to content

Latest commit

 

History

History
103 lines (87 loc) · 2.48 KB

File metadata and controls

103 lines (87 loc) · 2.48 KB
title transmit_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.transmit_as
dev_langs
C++
helpviewer_keywords
transmit_as attribute
ms.assetid 53d0b8ab-5b06-423e-83eb-3d01a10424b2
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

transmit_as

Instructs the compiler to associate a presented type that client and server applications manipulate, with a transmitted type.

Syntax

  
      [ transmit_as(  
   type  
) ]  

Parameters

type
Specifies the data type that is transmitted between client and server.

Remarks

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

Example

The following code shows a use of the transmit_as attribute:

// cpp_attr_ref_transmit_as.cpp  
// compile with: /LD  
#include "windows.h"  
[module(name="MyLibrary")];  
  
[export] typedef struct _TREE_NODE_TYPE {  
unsigned short data;   
struct _TREE_NODE_TYPE * left;  
struct _TREE_NODE_TYPE * right;   
} TREE_NODE_TYPE;  
  
[export] struct PACKED_NODE {  
   unsigned short data;   // same as normal node  
   int index;   // array index of parent  
};  
  
// A left node recursive built array of  
// the nodes in the tree.  Can be unpacked with  
// that knowledge  
[export] typedef struct _TREE_XMIT_TYPE {  
   int count;  
   [size_is(count)] PACKED_NODE node[];  
} TREE_XMIT_TYPE;  
  
[transmit_as(TREE_XMIT_TYPE)] typedef TREE_NODE_TYPE * TREE_TYPE;  

Requirements

Attribute Context

Applies to typedef
Repeatable No
Required attributes None
Invalid attributes None

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

See Also

IDL Attributes
Typedef, Enum, Union, and Struct Attributes
export