This structure describes a medium of transfer for data objects.
At a Glance
Header file: | Objidl.h |
Windows CE versions: | 2.0 and later |
Syntax
typedef struct tagSTGMEDIUM {
unsigned long tymed;
union {
Handle hGlobal;
char *lpszFileName;
LPSTREAM pstm;
LPSTORAGE pstg;
};
LPUNKNOWN pUnkForRelease;
} STGMEDIUM;
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 IUnknown interface.
Remarks
Th string you pass in the lpszFileName member must be allocated by using either GlobalAlloc or malloc.
See Also