transmit_as

指示编译器关联客户端和服务器应用程序操作的一个存在的类型,使用一个传输的类型。

[ transmit_as( 
   type 
) ]

参数

  • type
    指定传输是在客户端和服务器之间的数据类型。

备注

transmit_as C++ 特性具有与 transmit_as MIDL 属性相同。

示例

下面的代码演示 transmit_as 属性的用法:

// 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;

要求

属性上下文

适用对象

typedef

可重复

必需的特性

无效的特性

有关属性上下文的更多信息,请参见 属性上下文

请参见

参考

export

其他资源

IDL 特性

Typedef、Enum、Union 和 Struct 特性

Attributes Samples