NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

UnmanagedType Enumeration

Identifies how parameters or fields should be marshaled to unmanaged code.

[Visual Basic]
Public Enum UnmanagedType
[C#]
public enum UnmanagedType
[C++]
public enum UnmanagedType

[JScript] In JScript, you can use the enumerations in the NGWS frameworks, but you cannot define your own.

Members

Member Name Description
AnsiBStr ANSI character string that is a length prefixed, single byte.
AsAny Dynamic type that determines the type of an Object at runtime and marshals the Object as that type.
Bool 4-byte Boolean value (true != 0, false = 0).
BStr Unicode character string that is a length prefixed double byte.
ByValArray A fixed length array. The UnmanagedFormatAttribute must contain the count of elements in the array. The UnmanagedFormatAttribute may optionally contain the unmanaged type of the elements when it is necessary to differentiate among string types.
ByValTStr A string in a fixed length buffer. The type UnmanagedFormatAttribute must also contain the size of the buffer in bytes. The type of the characters is determined they the Charset used by the class.
CustomMarshaler Custom marshaler native type. This must be followed by a string of the following format: "Native type name\0Custom marshaler type name\0Optional cookie\0" Or "{Native type GUID}\0Custom marshaler type name\0Optional cookie\0"
Error This native type associated with an I4 or a U4 will cause the parameter to be exported as an HRESULT in the exported typelib.
FunctionPtr A function pointer.
I1 1-byte signed integer.
I2 2-byte signed integer.
I4 4-byte signed integer.
I8 8-byte signed integer.
IDispatch A COM IUnknown pointer. This unmanaged type only applies to object.
Interface A COM interface pointer. The GUID of the interface is obtained from the class metadata.
IUnknown A COM IUnknown pointer. This unmanaged type only applies to object.
LPArray An array whose length is determined at runtime by the size of the actual marshaled array. Optionally followed by the unmanaged type of the elements within the array when it is necessary to differentiate among string types. When marshaling from managed to unmanaged, the size of the array is determined dynamically. When marshaling from unmanaged to managed, the size is always assumed to be 1.
LPStr A single byte ANSI character string.
LPStruct A pointer to a C-style structure. Used to marshal managed formatted classes and value types.
LPTStr A platform independent character string, ANSI on Win9x, Unicode on WinNT.
LPVoid An un-typed 4-byte pointer.
LPWStr A double byte Unicode character string.
NativeTypeMax First invalid element type
R4 4-byte floating point number.
R8 8-byte floating point number.
RPrecise Size agnostic floating point number.
SafeArray An OLE Automation SafeArray. The UnmanagedFormatAttribute may optionally supply the unmanaged type of the elements within the array when it is necessary to differentiate among string types.
Struct A C-style structure, used to marshal managed formatted classes and value types.
SysInt A platform independent signed integer. 4-bytes on 32 bit Windows, 8-bytes on 64 bit Windows.
SysUInt Hardware natural sized unsigned integer
TBStr A length prefixed platform independent char string. ANSI on Windows 9x, Unicode on Windows NT.
U1 1-byte unsigned integer.
U2 2-byte unsigned integer.
U4 4-byte unsigned integer.
U8 8-byte unsigned integer.
VariantBool 8-byte unsigned integer.
VBByRefStr VB specific.

Requirements

Namespace: System.Runtime.InteropServices

Assembly: mscorlib.dll

See Also

System.Runtime.InteropServices Namespace