Platform SDK: MAPI |
A MapiFileDesc structure contains information about a file containing a message attachment stored as a temporary file. That file can contain a static OLE object, an embedded OLE object, an embedded message, and other types of files.
Header file: | MAPI.H |
typedef struct { ULONG ulReserved; ULONG flFlags; ULONG nPosition; LPTSTR lpszPathName; LPTSTR lpszFileName; LPVOID lpFileType; } MapiFileDesc, FAR *lpMapiFileDesc;
If neither flag is set, the attachment is treated as a data file.
Simple MAPI works with three kinds of embedded attachments:
Data file attachments are simply data files. OLE object file attachments are OLE objects that are displayed in the message text. If the OLE attachment is editable, the recipient can double-click it and its source application will be started to handle the edit session. If the OLE attachment is static, the object cannot be edited. The flag set in the flFlags member of the MapiFileDesc structure determines the kind of a particular attachment. Embedded messages can be identified by a .MSG extension in the lpszFileName member.
OLE object files are file representations of OLE object streams. The client application can recreate an OLE object from the file by calling the OLE function OleLoadFromStream with an OLESTREAM object that reads the file contents. If an OLE file attachment is included in an outbound message, the OLE object stream should be written directly to the file used as the attachment.
When using the MapiFileDesc member nPosition, the client application should not place two attachments in the same location. Client applications might not display file attachments at positions beyond the end of the message text.