Share via


Tipos de datos COM

Actualización: noviembre 2007

En la siguiente tabla se muestran los tipos de datos utilizados en COM y sus correspondientes tipos de valor o clases integrados de .NET Framework. Cualquier tipo no identificado explícitamente en esta tabla se convertirá en un tipo de sistema Int32. Para obtener los tipos correspondientes en Visual Basic 2005, C# y C++, vea la Introducción a la biblioteca de clases de .NET Framework.

Tipo de valor COM

Tipo de referencia COM

Tipo de sistema

bool

bool *

System.Int32

char, small

char *, small *

System.SByte

short

short *

System.Int16

long, int

long *, int *

System.Int32

Hyper

hyper *

System.Int64

unsigned char, byte

unsigned char *, byte *

System.Byte

wchar_t, unsigned short

wchar_t *, unsigned short *

System.UInt16

unsigned long, unsigned int

unsigned long *, unsigned int *

System.UInt32

unsigned hyper

unsigned hyper *

System.UInt64

float

float *

System.Single

double

double *

System.Double

VARIANT_BOOL

VARIANT_BOOL *

System.Boolean

void*

void **

System.IntPtr

HRESULT

HRESULT *

System.Int16 o System.IntPtr

SCODE

SCODE *

System.Int32

BSTR

BSTR *

System.String

LPSTR o [string, …] char *

LPSTR *

System.String

LPWSTR o [string, …] wchar_t *

LPWSTR *

System.String

VARIANT

VARIANT *

System.Object

DECIMAL

DECIMAL *

System.Decimal

DATE

DATE *

System.DateTime

GUID

GUID *

System.Guid

CURRENCY

CURRENCY *

System.Decimal

IUnknown *

IUnknown **

System.Object

IDispatch *

IDispatch **

System.Object

SAFEARRAY(type)

SAFEARRAY(type) *

type[]

En la siguiente tabla se enumeran los tipos de referencia y valor COM que se convierten a los tipos de elemento correspondientes. Por ejemplo, una coclase COM se asigna automáticamente a una clase administrada con el mismo nombre.

Tipo de valor COM

Tipo de referencia COM

Tipo de elemento

Typedef BaseType MiTipo

ByRef BaseType

BaseType

MiEstructura

ByRef VALUETYPE<MiEstructura>

valuetype<MiEstructura>

MiEnumeración

ByRef VALUETYPE<MiEnumeración>

valuetype<MiEnumeración>

MiInterfaz *

ByRef CLASS <MiInterfaz>

Class <MiInterfaz>

MiCoClase

ByRef CLASS <_Clase>

Class <_Clase>

Vea también

Conceptos

Personalizar contenedores COM a los que se puede llamar

Personalizar contenedores a los que se puede llamar en tiempo de ejecución

Otros recursos

Calcular referencias de datos con interoperabilidad COM