SUMINFO.H
资源名称:MSDN_VC98.zip [点击查看]
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:10k
源码类别:
Windows编程
开发平台:
Visual C++
- /*************************************************************************
- **
- ** OLE 2.0 Property Set Utilities
- **
- ** suminfo.h
- **
- ** This file contains file contains data structure defintions,
- ** function prototypes, constants, etc. for OLE 2.0 Property Set
- ** utilities used to manage the Summary Info property set.
- **
- ** (c) Copyright Microsoft Corp. 1990 - 1996 All Rights Reserved
- **
- *************************************************************************/
- #ifndef SUMINFO_H
- #define SUMINFO_H
- #include <ole2.h>
- #include <oleauto.h>
- /* A SUMINFO variable is an instance of an abstract data type. Thus,
- ** there can be an arbitrary number of SummaryInfo streams open
- ** simultaneously (subject to available memory). Each variable must
- ** be initialized prior to use by calling Init and freed after its
- ** last use by calling Free. The param argument to Init is reserved
- ** for future expansion and should be zero initially. Once a SUMINFO
- ** variable is allocated (by Init), the user can call the Set
- ** procedures to initialize fields. A copy of the arguments is made
- ** in every case except SetThumbnail where control of the storage
- ** occupied by the METAFILEPICT is merely transferred. When the
- ** Free routine is called, all storage will be deallocated including
- ** that of the thumbnail. The arguments to SetThumbNail and the
- ** return values from GetThumbNail correspond to the OLE2.0 spec.
- ** Note that on input, the thumbnail is read on demand but all the
- ** other properties are pre-loaded. The thumbnail is manipulated as
- ** a windows handle to a METAFILEPICT structure, which in turn
- ** contains a handle to the METAFILE. The transferClip argument on
- ** GetThumbNail, when set to true, transfers responsibility for
- ** storage management of the thumbnail to the caller; that is, after
- ** Free has been called, the handle is still valid. Clear can be
- ** used to free storage for all the properties but then you must
- ** call Read to load them again. All the code is based on FAR
- ** pointers.
- ** CoInitialize MUST be called PRIOR to calling OleStdInitSummaryInfo.
- ** Memory is allocated using the currently active IMalloc*
- ** allocator (as is returned by call CoGetMalloc(MEMCTX_TASK) ).
- **
- ** Common scenarios:
- ** Read SummaryInfo
- ** ----------------
- ** OleStdInitSummaryInfo()
- ** OleStdReadSummaryInfo()
- ** . . . . .
- ** call different Get routines
- ** . . . . .
- ** OleStdFreeSummaryInfo()
- **
- ** Create SummaryInfo
- ** ------------------
- ** OleStdInitSummaryInfo()
- ** call different Set routines
- ** OleStdWriteSummaryInfo()
- ** OleStdFreeSummaryInfo()
- **
- ** Update SummaryInfo
- ** ------------------
- ** OleStdInitSummaryInfo()
- ** OleStdReadSummaryInfo()
- ** OleStdGetThumbNailProperty(necessary only if no SetThumb)
- ** call different Set routines
- ** OleStdWriteSummaryInfo()
- ** OleStdFreeSummaryInfo()
- */
- #define WORDMAX 256 //current string max for APPS; 255 + null terminator
- typedef union {
- short iVal; /* VT_I2 */
- long lVal; /* VT_I4 */
- float fltVal; /* VT_R4 */
- double dblVal; /* VT_R8 */
- DWORD bool; /* VT_BOOL */
- SCODE scodeVal; /* VT_ERROR */
- DWORD systimeVal; /* VT_SYSTIME */
- unsigned char bstrVal[WORDMAX]; /* VT_BSTR */
- } VTUNION;
- typedef struct _PROPSETLIST
- {
- FMTID formatID;
- DWORD byteOffset;
- } PROPSETLIST;
- typedef struct _PROPIDLIST
- {
- DWORD propertyID;
- DWORD byteOffset;
- } PROPIDLIST;
- typedef struct _PROPVALUE
- {
- DWORD vtType;
- VTUNION vtValue;
- } PROPVALUE;
- typedef struct _SECTION
- {
- DWORD cBytes;
- DWORD cProperties;
- PROPIDLIST rgPropId[1/*cProperties*/]; //variable-length array
- PROPVALUE rgPropValue[1]; //CANNOT BE ACCESSED BY NAME; ONLY BY POINTER
- } SECTION;
- typedef struct _SUMMARYINFO
- {
- WORD byteOrder;
- WORD formatVersion;
- WORD getOSVersion;
- WORD osVersion;
- CLSID classId; //from compobj.h
- DWORD cSections;
- PROPSETLIST rgPropSet[1/*cSections*/]; //variable-length array
- SECTION rgSections[1/*cSections*/]; //CANNOT BE ACCESSED BY NAME; ONLY BY POINTER
- } SUMMARYINFO;
- #define osWinOnDos 0
- #define osMac 1
- #define osWinNT 2
- #define cPIDSI_STANDARD (PIDSI_DOC_SECURITY+1-2)
- #ifndef WIN32
- #define MAXWORD 256 //maximum string size for APPS at present
- #endif
- typedef struct _STDZ
- {
- DWORD vtType;
- union {
- DWORD vtByteCount;
- OLECHAR fill[4]; //use last byte as byte count for stz requests
- };
- OLECHAR rgchars[MAXWORD];
- } STDZ;
- #define VTCB fill[3] //used to set/get the count byte when in memory
- typedef struct _THUMB
- {
- DWORD vtType;
- DWORD cBytes; //clip size in memory
- DWORD selector; //on disk -1,win clip no. -2,mac clip no. -3,ole FMTID 0,bytes nameLength, format name
- DWORD clipFormat;
- LPOLESTR lpstzName;
- LPOLESTR lpByte;
- } THUMB;
- #define VT_CF_BYTES 0
- #define VT_CF_WIN (-1)
- #define VT_CF_MAC (-2)
- #define VT_CF_FMTID (-3)
- #define VT_CF_NAME (-4)
- #define VT_CF_EMPTY (-5)
- #define VT_CF_OOM (-6) // Out of memory
- typedef THUMB FAR *LPTHUMB;
- typedef STDZ FAR *LPSTDZ;
- typedef struct _TIME
- {
- DWORD vtType;
- FILETIME time;
- } TIME;
- typedef struct _INTS
- {
- DWORD vtType;
- DWORD value;
- } INTS;
- #define MAXTIME (PIDSI_LASTSAVE_DTM-PIDSI_EDITTIME+1)
- #define MAXINTS (PIDSI_CHARCOUNT-PIDSI_PAGECOUNT+1+1)
- #define MAXSTDZ (PIDSI_REVNUMBER-PIDSI_TITLE+1+1)
- typedef struct _STANDARDSECINMEM
- {
- DWORD cBytes;
- DWORD cProperties;
- PROPIDLIST rgPropId[cPIDSI_STANDARD/*cProperties*/]; //variable-length array
- TIME rgTime[MAXTIME];
- INTS rgInts[MAXINTS];
- LPSTDZ rglpsz[MAXSTDZ];
- THUMB thumb;
- } STANDARDSECINMEM;
- #define OFFSET_NIL 0X00000000
- #define AllSecurityFlagsEqNone 0
- #define fSecurityPassworded 1
- #define fSecurityRORecommended 2
- #define fSecurityRO 4
- #define fSecurityLockedForAnnotations 8
- #define PropStreamNamePrefixByte ' 05'
- #define PropStreamName "