ActiveXMessageFormatter.Read Method (Message)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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.

Exception Condition
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
Available since 1.1
Return to top
Show: