The ISmsMessage::SetAttachmentFromBuffer method, in Configuration Manager, sets an attachment from a byte buffer.

HRESULT SetAttachmentFromBuffer(
	LPCWSTR  szName,
	const BYTE*  pData,
	 ULONG  ulDataLen 



Data type: LPCWSTRQualifiers: [in]Null-terminated string specifying the name to associate with the attachment, represented by an ISmsMessageAttachment Interface object.

Data type: BYTEQualifiers: [in]Pointer to a buffer containing attachment contents.

Data type: ULONGQualifiers: [in]The length, in bytes, of the pData buffer.

Return Values

An HRESULT code. Possible values include, but are not limited to, the following:


The method succeeded.


Attachment names must be unique within a message. Setting an attachment with a name that already exists causes the old attachment to be overridden. Because this might be inefficient, clients should be designed to never set multiple attachments with the same name.

See Also

Send comments about this topic to Microsoft.