Condividi tramite


transmit_as

Indica al compilatore di associare un tipo presentato che le applicazioni client e server modificano, con un tipo trasmesso.

Sintassi

[ transmit_as(type) ]

Parametri

type
Specifica il tipo di dati trasmesso tra client e server.

Osservazioni:

L'attributo transmit_as C++ ha la stessa funzionalità dell'attributo TRANSMIT_AS MIDL.

Esempio

Il codice seguente illustra l'uso dell'attributo 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;

Requisiti

Contesto attributo Valore
Si applica a typedef
Ripetibile No
Attributi obbligatori None
Attributi non validi None

Per altre informazioni sui contesti di attributi, vedere Contesti di attributi.

Vedi anche

Attributi IDL
Attributi Typedef, Enum, Union e Struct
export