Share via


STGMEDIUM (Compact 2013)

3/26/2014

This structure describes a medium of transfer for data objects.

Syntax

typedef struct tagSTGMEDIUM {
  unsigned long tymed;
  union {
    HBITMAP hBitmap;
    HMETAFILEPICT hMetaFilePict;
    HENHMETAFILE hEnhMetaFile;
    HGLOBAL hGlobal;
    LPOLESTR lpszFileName;
    Istream* pstm;
    IStorage* pstg;
  }u;
  IUnknown* pUnkForRelease; 
} uSTGMEDIUM;

Members

  • tymed
    Type of storage medium.

    The marshaling and unmarshaling routines use this value to determine which union member was used.

    This value must be one of the elements of the TYMED enumeration.

  • union member
    A union containing a handle, string, or interface pointer that the receiving process can use to access the data being transferred.

    If tymed is TYMED_NULL, the union member is undefined.

  • hBitmap
    Handle to a bitmap.

    The tymed member is TYMED_GDI.

  • hMetaFilePict
    Handle to a metafile.

    The tymed member is TYMED_MFPICT.

  • hEnhMetaFile
    Handle to an enhanced metafile.

    The tymed member is TYMED_ENHMF.

  • hGlobal
    Global memory handle.

    The tymed member is TYMED_HGLOBAL.

  • lpszFileName
    Long pointer to the null-terminated string that contains the path of a disk file that contains the data.

    The tymed member is TYMED_FILE.

  • pstm
    Pointer to an IStream interface.

    The tymed member is TYMED_ISTREAM.

  • pstg
    Pointer to an IStorage interface.

    The tymed member is TYMED_ISTORAGE.

  • pUnkForRelease
    Pointer to an interface instance that allows the sending process to control the way the storage is released when the receiving process calls the ReleaseStgMedium function.

    If pUnkForRelease is NULL, ReleaseStgMedium uses default procedures to release the storage; otherwise, ReleaseStgMedium uses the specified IUnknown interface.

Remarks

The string you pass in the lpszFileName member must be allocated by using either GlobalAlloc or malloc.

Requirements

Header

objidl.h

See Also

Reference

OLE Structures
TYMED