ActiveXMessageFormatter.Write Method (Message, Object)

 
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.

Serializes an object into the body of the message.

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

public void Write(
	Message message,
	object obj
)

Parameters

message
Type: System.Messaging.Message

The Message whose Body property will contain the serialized object.

obj
Type: System.Object

The object to be serialized into the message body.

Exception Condition
InvalidOperationException

The object to serialize is neither a primitive nor a streamed object that implements the OLE IPersistStream interface.

ArgumentNullException

The message parameter is null.

The following table shows the relationship between managed types and the BodyType property. The object that you serialize must be one of these managed types or must implement the OLE IPersistStream interface.

BodyType value

Managed type

VT_LPSTR

Char

VT_BSTR, VT_LPWSTR

String

VT_VECTOR | VT_UI1

Byte

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

IPersistStream (OLE) Object

.NET Framework
Available since 1.1
Return to top
Show: