This topic has not yet been rated - Rate this topic

transmit_as

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

[ transmit_as( 
   type 
) ]
type

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

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

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;
Attribute Context

Applies to

typedef

Repeatable

No

Required attributes

None

Invalid attributes

None

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

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.