home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / propbag2.idl < prev    next >
Text File  |  1998-04-25  |  3KB  |  100 lines

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright 1993 - 1998 Microsoft Corporation.
  5. //
  6. //  File: propbag2.idl
  7. //
  8. //----------------------------------------------------------------------------
  9.  
  10. cpp_quote("//+-------------------------------------------------------------------------")
  11. cpp_quote("//")
  12. cpp_quote("//  Microsoft Windows")
  13. cpp_quote("//  Copyright 1993 - 1998 Microsoft Corporation.")
  14. cpp_quote("//")
  15. cpp_quote("//--------------------------------------------------------------------------")
  16.  
  17. #ifndef DO_NO_IMPORTS
  18. import "objidl.idl";
  19. import "oleidl.idl";
  20. import "servprov.idl";
  21.  
  22. //import "unknwn.idl";
  23. import "ocidl.idl";
  24. #endif
  25.  
  26. interface IPersistPropertyBag2;
  27. interface IPropertyBag2;
  28.  
  29. [object, uuid(22F55881-280B-11d0-A8A9-00A0C90C2004), pointer_default(unique)]
  30. interface IPersistPropertyBag2 : IPersist
  31. {
  32.     typedef [unique] IPersistPropertyBag2 *LPPERSISTPROPERTYBAG2;
  33.  
  34.     HRESULT InitNew();
  35.  
  36.     HRESULT Load(
  37.             [in]IPropertyBag2 * pPropBag,
  38.                 [in]IErrorLog * pErrLog);
  39.     HRESULT Save(
  40.             [in]IPropertyBag2 * pPropBag,
  41.                 [in]BOOL fClearDirty,
  42.                 [in]BOOL fSaveAllProperties);
  43.  
  44.     HRESULT IsDirty();
  45. }
  46.  
  47. typedef enum _tagPROPBAG2_TYPE
  48. {
  49.     PROPBAG2_TYPE_UNDEFINED = 0,
  50.     PROPBAG2_TYPE_DATA      = 1,    // Value is simple data
  51.     PROPBAG2_TYPE_URL       = 2,    // Value is a URL reference
  52.     PROPBAG2_TYPE_OBJECT    = 3,    // Value is an object
  53.     PROPBAG2_TYPE_STREAM    = 4,    // Value is a stream
  54.     PROPBAG2_TYPE_STORAGE   = 5,    // Value is a storage
  55.     PROPBAG2_TYPE_MONIKER   = 6    // Value is a moniker
  56. } PROPBAG2_TYPE;
  57.  
  58. typedef struct _tagPROPBAG2
  59. {
  60.     DWORD        dwType;        // Property type (from PROPBAG2_TYPE)
  61.     VARTYPE        vt;        // VARIANT property type
  62.     CLIPFORMAT    cfType;        // Clipboard format (aka MIME-type)
  63.     DWORD        dwHint;        // Property name hint
  64.     LPOLESTR    pstrName;    // Property name
  65.     CLSID        clsid;        // CLSID (for PROPBAG2_TYPE_OBJECT)
  66. } PROPBAG2;
  67.  
  68. [object, uuid(22F55882-280B-11d0-A8A9-00A0C90C2004), pointer_default(unique)]
  69. interface IPropertyBag2 : IUnknown
  70. {
  71.     typedef [unique]IPropertyBag2 *LPPROPERTYBAG2;
  72.  
  73.     HRESULT Read(
  74.             [in]    ULONG cProperties,
  75.             [in]    PROPBAG2 * pPropBag,
  76.             [in]      IErrorLog * pErrLog,
  77.             [out]     VARIANT * pvarValue,
  78.             [out]   HRESULT * phrError);
  79.  
  80.     HRESULT Write(
  81.             [in]    ULONG cProperties,
  82.             [in]     PROPBAG2 * pPropBag,
  83.             [in]     VARIANT * pvarValue);
  84.  
  85.     HRESULT CountProperties(
  86.             [out]     ULONG * pcProperties);
  87.             
  88.     HRESULT GetPropertyInfo(
  89.             [in]      ULONG iProperty,
  90.             [in]      ULONG cProperties,
  91.             [out]     PROPBAG2 * pPropBag,
  92.             [out]     ULONG * pcProperties);
  93.             
  94.     HRESULT LoadObject(
  95.             [in]    LPCOLESTR pstrName,
  96.             [in]    DWORD dwHint,
  97.             [in]    IUnknown * pUnkObject,
  98.             [in]    IErrorLog * pErrLog);
  99. }
  100.