STGMEDIUM

This structure describes a medium of transfer for data objects.

typedef struct tagSTGMEDIUM {
    DWORD 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
    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; otherwise, it is one of the following:

    Value Description
    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 interface.

Remarks

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

Requirements

Windows CE versions: 2.0 and later  
  Header file: Declared in Objidl.h

See Also

TYMED