Export (0) Print
Expand All

ActiveXMessageFormatter.Read Method

Reads the contents from the given message and creates an object that contains the deserialized message.

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

public Object Read(
	Message message
)

Parameters

message
Type: System.Messaging.Message

The Message, in MSMQ ActiveX control format, to deserialize.

Return Value

Type: System.Object
The deserialized message.

Implements

IMessageFormatter.Read(Message)

ExceptionCondition
InvalidOperationException

The BodyType property of the message passed as a parameter cannot be mapped to a primitive type, nor does it represent a streamed object.

NotSupportedException

The body represents a stored object. The ActiveXMessageFormatter does not support deserialization of stored objects.

ArgumentNullException

The message parameter is null.

If the body of the message represents a primitive type, the message's BodyType property must be one of the managed types in the following table.

BodyType value

Managed type

VT_LPSTR

Char array (deserialized using ASCII encoding)

VT_BSTR, VT_LPWSTR

String (deserialized using Unicode encoding)

VT_VECTOR | VT_UI1

Byte array

VT_BOOL

Boolean

VT_CLSID

Guid

VT_CY

Decimal

VT_DATE

DateTime

VT_I1, VT_UI1

Byte

VT_I2

Int16

VT_UI2

UInt16

VT_I4

Int32

VT_UI4

UInt32

VT_I8

Int64

VT_UI8

UInt64

VT_R4

Single

VT_R8

Double

VT_NULL

null

VT_STREAMED_OBJECT

Object

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft