home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / oaidl.idl < prev    next >
Encoding:
Text File  |  1995-07-11  |  48.2 KB  |  1,652 lines

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. //  File: oaidl.idl
  7. //
  8. //----------------------------------------------------------------------------
  9.  
  10. #ifndef DO_NO_IMPORTS
  11. import "objidl.idl";
  12. #endif
  13.  
  14. interface ITypeInfo;
  15. interface ITypeLib;
  16. interface IErrorInfo;
  17. interface ICreateErrorInfo;
  18. interface ISupportErrorInfo;
  19.  
  20. [
  21.   version(0.1), pointer_default(unique),
  22.   local  /* marshalling supplied by oleaut32.dll */
  23. ]
  24. interface RemVariant
  25. {
  26.  
  27. cpp_quote("//+-------------------------------------------------------------------------")
  28. cpp_quote("//")
  29. cpp_quote("//  Microsoft Windows")
  30. cpp_quote("//  Copyright (C) Microsoft Corporation, 1992 - 1995.")
  31. cpp_quote("//")
  32. cpp_quote("//--------------------------------------------------------------------------")
  33.  
  34. #ifndef HUGEP
  35. # ifdef WIN16
  36. #  define HUGEP _huge
  37. # else
  38. #  define HUGEP
  39. #  define FAR
  40. #  define FARSTRUCT
  41. # endif
  42. #endif
  43.  
  44. /* Forward Declarations */
  45. #ifdef HPP
  46. interface IDispatch;
  47. interface IStream;
  48. interface IStorage;
  49. interface IUnknown;
  50. #endif
  51.  
  52. /* IDL declarations for BSTR how to transmit them */
  53.  
  54. cpp_quote("/* XBSTR is for internal use only, it is subject to change */")
  55. typedef struct tagXBSTR {
  56.     ULONG cbSize;
  57.     [size_is(cbSize)]
  58.     OLECHAR  rgBstrData[];
  59.     } XBSTR;
  60.  
  61. typedef OLECHAR FAR* BSTR;
  62.  
  63. typedef BSTR FAR* LPBSTR;
  64.  
  65. /* Cairo extension: BLOB, CLIPDATA */
  66. cpp_quote("#ifndef _tagBLOB_DEFINED")
  67. cpp_quote("#define _tagBLOB_DEFINED")
  68. cpp_quote("#define _BLOB_DEFINED")
  69. cpp_quote("#define _LPBLOB_DEFINED")
  70. typedef struct tagBLOB {
  71.     ULONG cbSize;
  72.     [size_is(cbSize)]
  73.     BYTE  *pBlobData;
  74.     } BLOB, * LPBLOB;
  75. cpp_quote("#endif")
  76.  
  77. cpp_quote("#ifndef _tagCLIPDATA_DEFINED")
  78. cpp_quote("#define _tagCLIPDATA_DEFINED")
  79. cpp_quote("#define _CLIPDATA_DEFINED")
  80. typedef struct tagCLIPDATA {
  81.     ULONG cbSize;       // count that includes sizeof(ulClipFmt)
  82.     long ulClipFmt;     // long to keep alignment
  83.     [size_is(cbSize-4)]
  84.     BYTE * pClipData;   // cbSize-sizeof(ULONG) bytes of data in clipboard format
  85.     } CLIPDATA;
  86. cpp_quote("#endif")
  87.  
  88. cpp_quote("#ifndef _tagSAFEARRAYBOUND_DEFINED")
  89. cpp_quote("#define _tagSAFEARRAYBOUND_DEFINED")
  90. cpp_quote("#define _SAFEARRAYBOUND_DEFINED")
  91. cpp_quote("#define _LPSAFEARRAYBOUND_DEFINED")
  92. typedef struct tagSAFEARRAYBOUND {
  93.     ULONG cElements;
  94.     LONG lLbound;
  95. } SAFEARRAYBOUND, * LPSAFEARRAYBOUND;
  96. cpp_quote("#endif")
  97.  
  98.  
  99. cpp_quote("#ifndef _tagSAFEARRAY_DEFINED")
  100. cpp_quote("#define _tagSAFEARRAY_DEFINED")
  101. cpp_quote("#define _SAFEARRAY_DEFINED")
  102. cpp_quote("#define _LPSAFEARRAY_DEFINED")
  103. cpp_quote("#if 0")
  104. cpp_quote("/* the following is what RPC knows how to remote */")
  105. typedef struct FARSTRUCT tagSAFEARRAY {
  106.     unsigned short cDims;
  107.     unsigned short fFeatures;
  108. #if defined(_WIN32)
  109.     unsigned long cbElements;
  110.     unsigned long cLocks;
  111. #else
  112.     unsigned short cbElements;
  113.     unsigned short cLocks;
  114. #ifdef _MAC
  115.     Handle handle;
  116. #else
  117.     unsigned long handle;               // unused but kept for compatiblity
  118. #endif
  119. #endif
  120. #ifdef LATER
  121.     void HUGEP* pvData;
  122. #else
  123.     BYTE *pvData;
  124. #endif
  125.     [size_is(cDims)] SAFEARRAYBOUND rgsabound[];
  126. } SAFEARRAY, FAR* LPSAFEARRAY;
  127. cpp_quote("#else")
  128. cpp_quote("typedef struct FARSTRUCT tagSAFEARRAY {")
  129. cpp_quote("    unsigned short cDims;")
  130. cpp_quote("    unsigned short fFeatures;")
  131. cpp_quote("#if defined(_WIN32)")
  132. cpp_quote("    unsigned long cbElements;")
  133. cpp_quote("    unsigned long cLocks;")
  134. cpp_quote("#else")
  135. cpp_quote("    unsigned short cbElements;")
  136. cpp_quote("    unsigned short cLocks;")
  137. cpp_quote("    unsigned long handle;               // unused but kept for compatiblity")
  138. cpp_quote("#endif")
  139. cpp_quote("    void HUGEP* pvData;")
  140. cpp_quote("    SAFEARRAYBOUND rgsabound[1];")
  141. cpp_quote("} SAFEARRAY, FAR* LPSAFEARRAY;")
  142. cpp_quote("#endif")
  143.  
  144. cpp_quote("#endif")
  145.  
  146. const USHORT FADF_AUTO       = 0x0001;  /* the array is allocated on the stack */
  147. const USHORT FADF_STATIC     = 0x0002;  /* the array is staticly allocated */
  148. const USHORT FADF_EMBEDDED   = 0x0004;  /* array is embedded in a structure        */
  149. const USHORT FADF_FIXEDSIZE  = 0x0010;  /* array may not be resized or reallocated */
  150. const USHORT FADF_BSTR       = 0x0100;  /* an array of BSTRs */
  151. const USHORT FADF_UNKNOWN    = 0x0200;  /* an array of IUnknown* */
  152. const USHORT FADF_DISPATCH   = 0x0400;  /* and array of IDispatch* */
  153. const USHORT FADF_VARIANT    = 0x0800;  /* an array of VARIANTs */
  154. const USHORT FADF_RESERVED   = 0xF0E8;  /* reserved bits */
  155.  
  156. typedef double DATE;
  157.  
  158. /* This is a helper struct for use in handling currency. */
  159. cpp_quote("#ifndef _tagCY_DEFINED")
  160. cpp_quote("#define _tagCY_DEFINED")
  161. cpp_quote("#define _CY_DEFINED")
  162.  
  163. cpp_quote("#if 0")
  164. #if 0   // MIDL can't handle this
  165. cpp_quote("/* the following get a midl-generated tag added, which messes up */")
  166. cpp_quote("/* unqualified references to the Lo and Hi members under C++ */")
  167. typedef union tagCY {
  168.     struct {
  169. #ifdef _MAC
  170.         long      Hi;
  171.         long Lo;
  172. #else
  173.         unsigned long Lo;
  174.         long      Hi;
  175. #endif
  176.     };
  177.     LONGLONG    int64;
  178. } CY;
  179. #else //0
  180. cpp_quote("/* the following isn't the real definition of CY, but it is */")
  181. cpp_quote("/* what RPC knows how to remote */")
  182. typedef struct tagCY {
  183.     LONGLONG    int64;
  184. } CY;
  185. #endif //0
  186. cpp_quote("#else")
  187.  
  188. cpp_quote("/* real definition that makes the C++ compiler happy */")
  189. cpp_quote("typedef union tagCY {")
  190. cpp_quote("    struct {         ")
  191. cpp_quote("#ifdef _MAC          ")
  192. cpp_quote("        long      Hi;")
  193. cpp_quote("        long Lo;     ")
  194. cpp_quote("#else                ")
  195. cpp_quote("        unsigned long Lo;")
  196. cpp_quote("        long      Hi;")
  197. cpp_quote("#endif               ")
  198. cpp_quote("    };               ")
  199. cpp_quote("    LONGLONG int64;  ")
  200. cpp_quote("} CY;                ")
  201. cpp_quote("#endif")
  202.  
  203. cpp_quote("#endif")
  204.  
  205.  
  206. typedef CY CURRENCY;
  207.  
  208. cpp_quote("/* 0 == FALSE, -1 == TRUE */")
  209. typedef short VARIANT_BOOL;
  210. cpp_quote("#ifndef VARIANT_TRUE")
  211. cpp_quote("#define VARIANT_TRUE ((VARIANT_BOOL)0xffff)")
  212. cpp_quote("#endif")
  213. cpp_quote("#ifndef VARIANT_FALSE")
  214. cpp_quote("#define VARIANT_FALSE ((VARIANT_BOOL)0)")
  215. cpp_quote("#endif")
  216.  
  217.  
  218.  
  219. /*
  220.  * VARENUM usage key,
  221.  *
  222.  *   [V] - may appear in a VARIANT
  223.  *   [T] - may appear in a TYPEDESC
  224.  *   [P] - may appear in an OLE property set
  225.  *
  226.  */
  227. cpp_quote("#ifndef _VARENUM_DEFINED")
  228. cpp_quote("#define _VARENUM_DEFINED")
  229. /*
  230.  * VARENUM usage key,
  231.  *
  232.  *   [V] - may appear in a VARIANT
  233.  *   [T] - may appear in a TYPEDESC
  234.  *   [P] - may appear in an OLE property set
  235.  *   [S] - may appear in a Safe Array
  236.  *
  237.  */
  238. cpp_quote("/*")
  239. cpp_quote(" * VARENUM usage key,")
  240. cpp_quote(" *")
  241. cpp_quote(" * * [V] - may appear in a VARIANT")
  242. cpp_quote(" * * [T] - may appear in a TYPEDESC")
  243. cpp_quote(" * * [P] - may appear in an OLE property set")
  244. cpp_quote(" * * [S] - may appear in a Safe Array")
  245. cpp_quote(" *")
  246. cpp_quote(" *")
  247. cpp_quote(" *  VT_EMPTY            [V]   [P]     nothing                     ")
  248. cpp_quote(" *  VT_NULL             [V]           SQL style Null              ")
  249. cpp_quote(" *  VT_I2               [V][T][P][S]  2 byte signed int           ")
  250. cpp_quote(" *  VT_I4               [V][T][P][S]  4 byte signed int           ")
  251. cpp_quote(" *  VT_R4               [V][T][P][S]  4 byte real                 ")
  252. cpp_quote(" *  VT_R8               [V][T][P][S]  8 byte real                 ")
  253. cpp_quote(" *  VT_CY               [V][T][P][S]  currency                    ")
  254. cpp_quote(" *  VT_DATE             [V][T][P][S]  date                        ")
  255. cpp_quote(" *  VT_BSTR             [V][T][P][S]  OLE Automation string       ")
  256. cpp_quote(" *  VT_DISPATCH         [V][T]   [S]  IDispatch FAR*              ")
  257. cpp_quote(" *  VT_ERROR            [V][T]   [S]  SCODE                       ")
  258. cpp_quote(" *  VT_BOOL             [V][T][P][S]  True=-1, False=0            ")
  259. cpp_quote(" *  VT_VARIANT          [V][T][P][S]  VARIANT FAR*                ")
  260. cpp_quote(" *  VT_UNKNOWN          [V][T]   [S]  IUnknown FAR*               ")
  261.  
  262. cpp_quote(" *  VT_I1                  [T]        signed char                 ")
  263. cpp_quote(" *  VT_UI1              [V][T]   [S]  unsigned char               ")
  264. cpp_quote(" *  VT_UI2                 [T]        unsigned short              ")
  265. cpp_quote(" *  VT_UI4                 [T]        unsigned short              ")
  266. cpp_quote(" *  VT_I8                  [T][P]     signed 64-bit int           ")
  267. cpp_quote(" *  VT_UI8                 [T]        unsigned 64-bit int         ")
  268. cpp_quote(" *  VT_INT                 [T]        signed machine int          ")
  269. cpp_quote(" *  VT_UINT                [T]        unsigned machine int        ")
  270. cpp_quote(" *  VT_VOID                [T]        C style void                ")
  271. cpp_quote(" *  VT_HRESULT             [T]                                    ")
  272. cpp_quote(" *  VT_PTR                 [T]        pointer type                ")
  273. cpp_quote(" *  VT_SAFEARRAY           [T]        (use VT_ARRAY in VARIANT)   ")
  274. cpp_quote(" *  VT_CARRAY              [T]        C style array               ")
  275. cpp_quote(" *  VT_USERDEFINED         [T]        user defined type           ")
  276. cpp_quote(" *  VT_LPSTR               [T][P]     null terminated string      ")
  277. cpp_quote(" *  VT_LPWSTR              [T][P]     wide null terminated string ")
  278.  
  279. cpp_quote(" *  VT_FILETIME               [P]     FILETIME                    ")
  280. cpp_quote(" *  VT_BLOB                   [P]     Length prefixed bytes       ")
  281. cpp_quote(" *  VT_STREAM                 [P]     Name of the stream follows  ")
  282. cpp_quote(" *  VT_STORAGE                [P]     Name of the storage follows ")
  283. cpp_quote(" *  VT_STREAMED_OBJECT        [P]     Stream contains an object   ")
  284. cpp_quote(" *  VT_STORED_OBJECT          [P]     Storage contains an object  ")
  285. cpp_quote(" *  VT_BLOB_OBJECT            [P]     Blob contains an object     ")
  286. cpp_quote(" *  VT_CF                     [P]     Clipboard format            ")
  287. cpp_quote(" *  VT_CLSID                  [P]     A Class ID                  ")
  288.  
  289. cpp_quote(" *  VT_VECTOR                 [P]     simple counted array        ")
  290. cpp_quote(" *  VT_ARRAY            [V]           SAFEARRAY*                  ")
  291. cpp_quote(" *  VT_BYREF            [V]                                       ")
  292. cpp_quote(" */")
  293.  
  294. enum VARENUM
  295. {
  296.     VT_EMPTY           = 0,
  297.     VT_NULL            = 1,
  298.     VT_I2              = 2,
  299.     VT_I4              = 3,
  300.     VT_R4              = 4,
  301.     VT_R8              = 5,
  302.     VT_CY              = 6,
  303.     VT_DATE            = 7,
  304.     VT_BSTR            = 8,
  305.     VT_DISPATCH        = 9,
  306.     VT_ERROR           = 10,
  307.     VT_BOOL            = 11,
  308.     VT_VARIANT         = 12,
  309.     VT_UNKNOWN         = 13,
  310.  
  311.     VT_I1              = 16,
  312.     VT_UI1             = 17,
  313.     VT_UI2             = 18,
  314.     VT_UI4             = 19,
  315.     VT_I8              = 20,
  316.     VT_UI8             = 21,
  317.     VT_INT             = 22,
  318.     VT_UINT            = 23,
  319.     VT_VOID            = 24,
  320.     VT_HRESULT         = 25,
  321.     VT_PTR             = 26,
  322.     VT_SAFEARRAY       = 27,
  323.     VT_CARRAY          = 28,
  324.     VT_USERDEFINED     = 29,
  325.     VT_LPSTR           = 30,
  326.     VT_LPWSTR          = 31,
  327.  
  328.     VT_FILETIME        = 64,
  329.     VT_BLOB            = 65,
  330.     VT_STREAM          = 66,
  331.     VT_STORAGE         = 67,
  332.     VT_STREAMED_OBJECT = 68,
  333.     VT_STORED_OBJECT   = 69,
  334.     VT_BLOB_OBJECT     = 70,
  335.     VT_CF              = 71,
  336.     VT_CLSID           = 72
  337. };
  338. cpp_quote("#endif")
  339.  
  340.  
  341. const USHORT VT_VECTOR =     0x1000;
  342. const USHORT VT_ARRAY  =     0x2000;
  343. const USHORT VT_BYREF  =     0x4000;
  344. const USHORT VT_RESERVED =   0x8000;
  345.  
  346.  
  347. cpp_quote("#ifndef _VARTYPE_DEFINED")
  348. cpp_quote("#define _VARTYPE_DEFINED")
  349. typedef unsigned short VARTYPE;
  350. cpp_quote("#endif")
  351.  
  352. typedef struct tagVARIANT VARIANT;
  353.  
  354. cpp_quote("/* forward declare IDispatch */")
  355. cpp_quote("typedef interface IDispatch IDispatch;")
  356.  
  357. cpp_quote("/* VARIANT STRUCTURE")
  358. cpp_quote(" *")
  359. cpp_quote(" *  VARTYPE vt;")
  360. cpp_quote(" *  unsigned short wReserved1;")
  361. cpp_quote(" *  unsigned short wReserved2;")
  362. cpp_quote(" *  unsigned short wReserved3;")
  363. cpp_quote(" *  union {")
  364. cpp_quote(" *    unsigned char        VT_UI1               ")
  365. cpp_quote(" *    short                VT_I2                ")
  366. cpp_quote(" *    long                 VT_I4                ")
  367. cpp_quote(" *    float                VT_R4                ")
  368. cpp_quote(" *    double               VT_R8                ")
  369. cpp_quote(" *    VARIANT_BOOL         VT_BOOL              ")
  370. cpp_quote(" *    SCODE                VT_ERROR             ")
  371. cpp_quote(" *    CY                   VT_CY                ")
  372. cpp_quote(" *    DATE                 VT_DATE              ")
  373. cpp_quote(" *    BSTR                 VT_BSTR              ")
  374. cpp_quote(" *    IUnknown FAR*        VT_UNKNOWN           ")
  375. cpp_quote(" *    IDispatch FAR*       VT_DISPATCH          ")
  376. cpp_quote(" *    SAFEARRAY FAR*       VT_ARRAY|*           ")
  377.  
  378. cpp_quote(" *    short FAR*           VT_BYREF|VT_I2       ")
  379. cpp_quote(" *    long FAR*            VT_BYREF|VT_I4       ")
  380. cpp_quote(" *    float FAR*           VT_BYREF|VT_R4       ")
  381. cpp_quote(" *    double FAR*          VT_BYREF|VT_R8       ")
  382. cpp_quote(" *    VARIANT_BOOL FAR*    VT_BYREF|VT_BOOL     ")
  383. cpp_quote(" *    SCODE FAR*           VT_BYREF|VT_ERROR    ")
  384. cpp_quote(" *    CY FAR*              VT_BYREF|VT_CY       ")
  385. cpp_quote(" *    DATE FAR*            VT_BYREF|VT_DATE     ")
  386. cpp_quote(" *    BSTR FAR*            VT_BYREF|VT_BSTR     ")
  387. cpp_quote(" *    IUnknown FAR* FAR*   VT_BYREF|VT_UNKNOWN  ")
  388. cpp_quote(" *    IDispatch FAR* FAR*  VT_BYREF|VT_DISPATCH ")
  389. cpp_quote(" *    SAFEARRAY FAR* FAR*  VT_BYREF|VT_ARRAY|*  ")
  390. cpp_quote(" *    VARIANT FAR*         VT_BYREF|VT_VARIANT  ")
  391.  
  392. cpp_quote(" *    void FAR*            Generic ByRef        ")
  393. cpp_quote(" */")
  394.  
  395. cpp_quote("#ifndef _tagVARIANT_DEFINED")
  396. cpp_quote("#define _tagVARIANT_DEFINED")
  397. cpp_quote("#if 0")
  398. cpp_quote("/* the following is what RPC knows how to remote */")
  399. struct tagVARIANT{
  400.     VARTYPE vt;
  401.     WORD wReserved1;
  402.     WORD wReserved2;
  403.     WORD wReserved3;
  404.     [switch_type(unsigned short), switch_is((unsigned short) (vt & 0x1fff))] union
  405.     {
  406. [case(VT_I4)]   // moved first so you can statically init most of the structure
  407.       long          lVal;           /* VT_I4                */
  408. [case(VT_UI1)]
  409.       unsigned char bVal;           /* VT_UI1               */
  410. [case(VT_I2)]
  411.       short         iVal;           /* VT_I2                */
  412. [case(VT_R4)]
  413.       float         fltVal;         /* VT_R4                */
  414. [case(VT_R8)]
  415.       double        dblVal;         /* VT_R8                */
  416. [case(VT_BOOL)]
  417.       VARIANT_BOOL  bool;           /* VT_BOOL              */
  418. [case(VT_ERROR)]
  419.       SCODE         scode;          /* VT_ERROR             */
  420. [case(VT_CY)]
  421.       CY            cyVal;          /* VT_CY                */
  422. [case(VT_DATE)]
  423.       DATE          date;           /* VT_DATE              */
  424. [case(VT_BSTR)]
  425.       BSTR          bstrVal;        /* VT_BSTR              */
  426.  
  427. #if !defined(NO_MARSHAL_INTERFACE)
  428. [case(VT_UNKNOWN)]
  429.       IUnknown      *punkVal;       /* VT_UNKNOWN           */
  430. #endif //!defined(NO_MARSHAL_INTERFACE)
  431.  
  432. #ifdef HPP
  433. [case(VT_DISPATCH)]
  434.       IDispatch     *pdispVal;      /* VT_DISPATCH          */
  435. #endif
  436.  
  437. [case(VT_ARRAY)]
  438.       SAFEARRAY     *parray;        /* VT_ARRAY|*           */
  439.  
  440. [case(VT_UI1|VT_BYREF)]
  441.       unsigned char *pbVal;         /* VT_BYREF|VT_UI1      */
  442. [case(VT_I2|VT_BYREF)]
  443.       short         *piVal;         /* VT_BYREF|VT_I2       */
  444. [case(VT_I4|VT_BYREF)]
  445.       long          *plVal;         /* VT_BYREF|VT_I4       */
  446. [case(VT_R4|VT_BYREF)]
  447.       float         *pfltVal;       /* VT_BYREF|VT_R4       */
  448. [case(VT_R8|VT_BYREF)]
  449.       double        *pdblVal;       /* VT_BYREF|VT_R8       */
  450. [case(VT_BOOL|VT_BYREF)]
  451.       VARIANT_BOOL  *pbool;         /* VT_BYREF|VT_BOOL     */
  452. [case(VT_ERROR|VT_BYREF)]
  453.       SCODE         *pscode;        /* VT_BYREF|VT_ERROR    */
  454. [case(VT_CY|VT_BYREF)]
  455.       CY            *pcyVal;        /* VT_BYREF|VT_CY       */
  456. [case(VT_DATE|VT_BYREF)]
  457.       DATE          *pdate;         /* VT_BYREF|VT_DATE     */
  458. [case(VT_BSTR|VT_BYREF)]
  459.       BSTR          *pbstrVal;      /* VT_BYREF|VT_BSTR     */
  460.  
  461. #if !defined(NO_MARSHAL_INTERFACE)
  462. [case(VT_UNKNOWN|VT_BYREF)]
  463.       IUnknown      **ppunkVal;     /* VT_BYREF|VT_UNKNOWN  */
  464. #endif //!defined(NO_MARSHAL_INTERFACE)
  465.  
  466. #ifdef HPP
  467. [case(VT_DISPATCH|VT_BYREF)]
  468.       IDispatch     **ppdispVal;    /* VT_BYREF|VT_DISPATCH */
  469. #endif
  470.  
  471. [case(VT_ARRAY|VT_BYREF)]
  472.       SAFEARRAY     **pparray;      /* VT_BYREF|VT_ARRAY|*  */
  473. [case(VT_VARIANT, VT_VARIANT|VT_BYREF)]
  474.       VARIANT       *pvarVal;       /* VT_BYREF|VT_VARIANT  */
  475. [case(VT_BYREF)]
  476. #ifdef LATER
  477.       void     * byref;             /* Generic ByRef        */
  478. #else
  479.       long     * byref;             /* form midl likes */
  480. #endif
  481.     }
  482. #if(defined(NONAMELESSUNION))
  483.     u
  484. #endif
  485.      ;
  486. };
  487. cpp_quote("#endif")
  488.  
  489. cpp_quote("struct tagVARIANT{")
  490. cpp_quote("    VARTYPE vt;")
  491. cpp_quote("    WORD wReserved1;")
  492. cpp_quote("    WORD wReserved2;")
  493. cpp_quote("    WORD wReserved3;")
  494. cpp_quote("    union")
  495. cpp_quote("    {")
  496. cpp_quote("      long          lVal;           /* VT_I4                */")
  497. cpp_quote("      unsigned char bVal;           /* VT_UI1               */")
  498. cpp_quote("      short         iVal;           /* VT_I2                */")
  499. cpp_quote("      float         fltVal;         /* VT_R4                */")
  500. cpp_quote("      double        dblVal;         /* VT_R8                */")
  501. cpp_quote("      VARIANT_BOOL  bool;           /* VT_BOOL              */")
  502. cpp_quote("      SCODE         scode;          /* VT_ERROR             */")
  503. cpp_quote("      CY            cyVal;          /* VT_CY                */")
  504. cpp_quote("      DATE          date;           /* VT_DATE              */")
  505. cpp_quote("      BSTR          bstrVal;        /* VT_BSTR              */")
  506. cpp_quote("      IUnknown      *punkVal;       /* VT_UNKNOWN           */")
  507. cpp_quote("      IDispatch     *pdispVal;      /* VT_DISPATCH          */")
  508. cpp_quote("      SAFEARRAY     *parray;        /* VT_ARRAY|*           */")
  509. cpp_quote("      unsigned char *pbVal;         /* VT_BYREF|VT_UI1      */")
  510. cpp_quote("      short         *piVal;         /* VT_BYREF|VT_I2       */")
  511. cpp_quote("      long          *plVal;         /* VT_BYREF|VT_I4       */")
  512. cpp_quote("      float         *pfltVal;       /* VT_BYREF|VT_R4       */")
  513. cpp_quote("      double        *pdblVal;       /* VT_BYREF|VT_R8       */")
  514. cpp_quote("      VARIANT_BOOL  *pbool;         /* VT_BYREF|VT_BOOL     */")
  515. cpp_quote("      SCODE         *pscode;        /* VT_BYREF|VT_ERROR    */")
  516. cpp_quote("      CY            *pcyVal;        /* VT_BYREF|VT_CY       */")
  517. cpp_quote("      DATE          *pdate;         /* VT_BYREF|VT_DATE     */")
  518. cpp_quote("      BSTR          *pbstrVal;      /* VT_BYREF|VT_BSTR     */")
  519. cpp_quote("      IUnknown      **ppunkVal;     /* VT_BYREF|VT_UNKNOWN  */")
  520. cpp_quote("      IDispatch     **ppdispVal;    /* VT_BYREF|VT_DISPATCH */")
  521. cpp_quote("      SAFEARRAY     **pparray;      /* VT_BYREF|VT_ARRAY|*  */")
  522. cpp_quote("      VARIANT       *pvarVal;       /* VT_BYREF|VT_VARIANT  */")
  523. cpp_quote("      void     * byref;             /* Generic ByRef        */")
  524. cpp_quote("    }")
  525. cpp_quote("#if(defined(NONAMELESSUNION))")
  526. cpp_quote("    u")
  527. cpp_quote("#endif")
  528. cpp_quote("     ;")
  529. cpp_quote("};")
  530.  
  531. cpp_quote("#endif")
  532.  
  533.     cpp_quote("#ifndef _LPVARIANT_DEFINED")
  534.     cpp_quote("#define _LPVARIANT_DEFINED")
  535.     typedef struct tagVARIANT * LPVARIANT;
  536.     cpp_quote("#endif")
  537.  
  538.     cpp_quote("#ifndef _VARIANTARG_DEFINED")
  539.     cpp_quote("#define _VARIANTARG_DEFINED")
  540.     typedef struct tagVARIANT VARIANTARG;
  541.     cpp_quote("#endif")
  542.  
  543.     cpp_quote("#ifndef _LPVARIANTARG_DEFINED")
  544.     cpp_quote("#define _LPVARIANTARG_DEFINED")
  545.     typedef struct tagVARIANT * LPVARIANTARG;
  546.     cpp_quote("#endif")
  547.  
  548.  
  549.  
  550. //TypeInfo stuff.
  551.  
  552.     cpp_quote("#ifndef _DISPID_DEFINED")
  553.     cpp_quote("#define _DISPID_DEFINED")
  554.     typedef LONG DISPID;
  555.     cpp_quote("#endif")
  556.  
  557.  
  558.     cpp_quote("#ifndef _MEMBERID_DEFINED")
  559.     cpp_quote("#define _MEMBERID_DEFINED")
  560.     typedef DISPID MEMBERID;
  561.     cpp_quote("#endif")
  562.  
  563.     cpp_quote("#ifndef _HREFTYPE_DEFINED")
  564.     cpp_quote("#define _HREFTYPE_DEFINED")
  565.     typedef DWORD HREFTYPE;
  566.     cpp_quote("#endif")
  567.  
  568. // Property stuff
  569.     typedef ULONG PROPID;
  570.  
  571.  
  572. typedef [transmit_as(long)] enum tagTYPEKIND
  573. {
  574.     TKIND_ENUM = 0,
  575.     TKIND_RECORD,
  576.     TKIND_MODULE,
  577.     TKIND_INTERFACE,
  578.     TKIND_DISPATCH,
  579.     TKIND_COCLASS,
  580.     TKIND_ALIAS,
  581.     TKIND_UNION,
  582.     TKIND_MAX                   /* end of enum marker */
  583. } TYPEKIND;
  584. cpp_quote("#define TYPEKIND_to_xmit(pEnum, ppLong) *(ppLong) = (long *) (pEnum)")
  585. cpp_quote("#define TYPEKIND_from_xmit(pLong, pEnum) *(pEnum) = (TYPEKIND) *(pLong)")
  586. cpp_quote("#define TYPEKIND_free_inst(pEnum) ")
  587. cpp_quote("#define TYPEKIND_free_xmit(pLong) ")
  588.  
  589.  
  590.  
  591. cpp_quote("#ifndef _tagTYPEDESC_DEFINED")
  592. cpp_quote("#define _tagTYPEDESC_DEFINED")
  593. cpp_quote("#define _TYPEDESC_DEFINED")
  594.  
  595. cpp_quote("/* VT_PTR - lptdesc, the pointed at type */")
  596. cpp_quote("/* VT_CARRAY - lpadesc */")
  597. cpp_quote("/* VT_USERDEFINED - hreftype, used to get the UDT typeinfo */")
  598.  
  599. typedef struct tagTYPEDESC {
  600.     [switch_type(short), switch_is((short)vt)] union
  601.     {
  602.       [case(VT_PTR)] struct tagTYPEDESC * lptdesc;
  603.       [case(VT_CARRAY)] struct tagARRAYDESC * lpadesc;
  604.       [case(VT_USERDEFINED)] HREFTYPE hreftype;
  605.     }
  606. #if(defined(NONAMELESSUNION))
  607.     u
  608. #endif
  609.     ;
  610.     VARTYPE vt;
  611. } TYPEDESC;
  612. cpp_quote("#endif")
  613.  
  614.  
  615. cpp_quote("#ifndef _tagARRAYDESC_DEFINED")
  616. cpp_quote("#define _tagARRAYDESC_DEFINED")
  617. cpp_quote("#define _ARRAYDESC_DEFINED")
  618. cpp_quote("#if 0")
  619.     typedef struct tagARRAYDESC {
  620.         TYPEDESC tdescElem;     /* element type */
  621.         USHORT cDims;       /* dimension count */
  622.         [size_is(cDims)] SAFEARRAYBOUND rgbounds[]; /* variable length array of bounds */
  623.     } ARRAYDESC;
  624. cpp_quote("#else")
  625. cpp_quote("typedef struct tagARRAYDESC {")
  626. cpp_quote("    TYPEDESC tdescElem;     /* element type */")
  627. cpp_quote("    USHORT cDims;       /* dimension count */")
  628. cpp_quote("    SAFEARRAYBOUND rgbounds[1]; /* variable length array of bounds */")
  629. cpp_quote("} ARRAYDESC;")
  630. cpp_quote("#endif")
  631. cpp_quote("#endif")
  632.  
  633.  
  634. cpp_quote("#ifndef _tagIDLDESC_DEFINED")
  635. cpp_quote("#define _tagIDLDESC_DEFINED")
  636. cpp_quote("#define _IDLDESC_DEFINED")
  637. cpp_quote("#define _LPIDLDESC_DEFINED")
  638. cpp_quote("#ifdef _WIN32")
  639. typedef struct FARSTRUCT tagIDLDESC {
  640. #if defined(_WIN32) || defined(_MAC)
  641.     unsigned long dwReserved;
  642. #else
  643.     BSTR bstrIDLInfo;           /* reserved, but original name retained for
  644.                                    compatibilty */
  645. #endif
  646.     unsigned short wIDLFlags;   /* IN, OUT, etc */
  647. } IDLDESC, FAR* LPIDLDESC;
  648.  
  649. cpp_quote("#else")
  650. cpp_quote("typedef struct FARSTRUCT tagIDLDESC {")
  651. cpp_quote("#if defined(_WIN32)")
  652. cpp_quote("    unsigned long dwReserved;")
  653. cpp_quote("#else")
  654. cpp_quote("    BSTR bstrIDLInfo;           /* reserved, but original name retained for")
  655. cpp_quote("                                   compatibilty */")
  656. cpp_quote("#endif")
  657. cpp_quote("    unsigned short wIDLFlags;   /* IN, OUT, etc */")
  658. cpp_quote("} IDLDESC, FAR* LPIDLDESC;")
  659. cpp_quote("#endif")
  660. cpp_quote("#endif")
  661.  
  662.  
  663. cpp_quote("#ifndef _tagELEMDESC_DEFINED")
  664. cpp_quote("#define _tagELEMDESC_DEFINED")
  665. cpp_quote("#define _ELEMDESC_DEFINED")
  666. cpp_quote("#define _LPELEMDESC_DEFINED")
  667. typedef struct tagELEMDESC {
  668.     TYPEDESC tdesc;     /* the type of the element */
  669.     IDLDESC idldesc;        /* info for remoting the element */
  670. } ELEMDESC, * LPELEMDESC;
  671. cpp_quote("#endif")
  672.  
  673.  
  674. cpp_quote("#ifndef _tagTYPEATTR_DEFINED")
  675. cpp_quote("#define _tagTYPEATTR_DEFINED")
  676. cpp_quote("#define _TYPEATTR_DEFINED")
  677. cpp_quote("#define _LPTYPEATTR_DEFINED")
  678. typedef struct tagTYPEATTR {
  679.     GUID guid;          /* the GUID of the TypeInfo */
  680.     LCID lcid;          /* locale of member names and doc strings */
  681.     DWORD dwReserved;
  682.     MEMBERID memidConstructor;  /* ID of constructor, MEMBERID_NIL if none */
  683.     MEMBERID memidDestructor;   /* ID of destructor, MEMBERID_NIL if none */
  684.     LPOLESTR lpstrSchema;
  685.     ULONG cbSizeInstance;    /* the size of an instance of this type */
  686.     TYPEKIND typekind;      /* the kind of type this typeinfo describes */
  687.     WORD cFuncs;        /* number of functions */
  688.     WORD cVars;         /* number of variables / data members */
  689.     WORD cImplTypes;        /* number of implemented interfaces */
  690.     WORD cbSizeVft;     /* the size of this types virtual func table */
  691.     WORD cbAlignment;       /* specifies the alignment requirements for
  692.                    an instance of this type,
  693.                      0 = align on 64k boundary
  694.                      1 = byte align
  695.                      2 = word align
  696.                      4 = dword align... */
  697.     WORD wTypeFlags;
  698.     WORD wMajorVerNum;      /* major version number */
  699.     WORD wMinorVerNum;      /* minor version number */
  700.     TYPEDESC tdescAlias;    /* if typekind == TKIND_ALIAS this field
  701.                    specifies the type for which this type
  702.                    is an alias */
  703.     IDLDESC idldescType;        /* IDL attributes of the described type */
  704. } TYPEATTR, * LPTYPEATTR;
  705. cpp_quote("#endif")
  706.  
  707.  
  708. typedef struct tagDISPPARAMS{
  709.     [size_is(cArgs)] VARIANTARG * rgvarg;
  710.     [size_is(cNamedArgs)] DISPID * rgdispidNamedArgs;
  711.     UINT cArgs;
  712.     UINT cNamedArgs;
  713. } DISPPARAMS;
  714.  
  715.  
  716. typedef struct tagRemEXCEPINFO {
  717.     WORD wCode;             /* An error code describing the error. */
  718.     WORD wReserved;
  719.     DWORD dwHelpContext;    /* help context of topic within the help file. */
  720.     DWORD scode;
  721.     DWORD cSource;
  722.     DWORD cDescription;
  723.     DWORD cHelpFile;
  724.     [size_is(cSource + cDescription + cHelpFile)] OLECHAR strings[]; //Contains bstrSource, bstrDescription, bstrHelpFile.
  725. }  RemEXCEPINFO;
  726.  
  727.  
  728. cpp_quote("#if 0")
  729. typedef [transmit_as(RemEXCEPINFO)] struct tagEXCEPINFO {
  730.     WORD wCode;             /* An error code describing the error. */
  731.     WORD wReserved;
  732.  
  733.     BSTR bstrSource;        /* A textual, human readable name of the
  734.                    source of the exception. It is up to the
  735.                    IDispatch implementor to fill this in.
  736.                    Typically this will be an application name. */
  737.  
  738.     BSTR bstrDescription;   /* A textual, human readable description of the
  739.                    error. If no description is available, NULL
  740.                    should be used. */
  741.  
  742.     BSTR bstrHelpFile;      /* Fully qualified drive, path, and file name
  743.                    of a help file with more information about
  744.                    the error.  If no help is available, NULL
  745.                    should be used. */
  746.  
  747.     DWORD dwHelpContext;    /* help context of topic within the help file. */
  748.  
  749.     [unique] void * pvReserved;
  750.  
  751.     HRESULT (__stdcall * pfnDeferredFillIn)(struct tagEXCEPINFO *);
  752.                 /* Use of this field allows an application
  753.                    to defer filling in the bstrDescription,
  754.                    bstrHelpFile, and dwHelpContext fields
  755.                    until they are needed.  This field might
  756.                    be used, for example, if loading the
  757.                    string for the error is a time-consuming
  758.                    operation. If deferred fill-in is not
  759.                    desired, this field should be set to NULL. */
  760.  
  761.     SCODE scode;
  762. }  EXCEPINFO, * LPEXCEPINFO;
  763. cpp_quote("#else")
  764. cpp_quote("typedef struct tagEXCEPINFO {")
  765. cpp_quote("    WORD wCode;")
  766. cpp_quote("    WORD wReserved;")
  767. cpp_quote("    BSTR bstrSource;")
  768. cpp_quote("    BSTR bstrDescription;")
  769. cpp_quote("    BSTR bstrHelpFile;")
  770. cpp_quote("    DWORD dwHelpContext;")
  771. cpp_quote("    void __RPC_FAR * pvReserved;")
  772. cpp_quote("    HRESULT (__stdcall __RPC_FAR * pfnDeferredFillIn)(struct tagEXCEPINFO __RPC_FAR *);")
  773. cpp_quote("    SCODE scode;")
  774. cpp_quote("}  EXCEPINFO, __RPC_FAR * LPEXCEPINFO;")
  775. cpp_quote("#endif")
  776.  
  777.  
  778. typedef [transmit_as(long)] enum tagCALLCONV {
  779.       CC_CDECL = 1
  780.     , CC_MSCPASCAL
  781.     , CC_PASCAL = CC_MSCPASCAL
  782.     , CC_MACPASCAL
  783.     , CC_STDCALL
  784.     , CC_RESERVED
  785.     , CC_SYSCALL
  786.     , CC_MPWCDECL
  787.     , CC_MPWPASCAL
  788.     , CC_MAX                    /* end of enum marker */
  789. #ifdef _MAC
  790.     , CC_FORCELONG = 2147483647
  791. #endif
  792. } CALLCONV;
  793.  
  794.  
  795.  
  796.  
  797. cpp_quote("#define CALLCONV_to_xmit(pEnum, ppLong) *(ppLong) = (long *) (pEnum)")
  798. cpp_quote("#define CALLCONV_from_xmit(pLong, pEnum) *(pEnum) = (CALLCONV) *(pLong)")
  799. cpp_quote("#define CALLCONV_free_inst(pEnum) ")
  800. cpp_quote("#define CALLCONV_free_xmit(pLong) ")
  801.  
  802.  
  803. typedef [transmit_as(long)] enum tagFUNCKIND {
  804.     FUNC_VIRTUAL,
  805.     FUNC_PUREVIRTUAL,
  806.     FUNC_NONVIRTUAL,
  807.     FUNC_STATIC,
  808.     FUNC_DISPATCH
  809. } FUNCKIND;
  810. cpp_quote("#define FUNCKIND_to_xmit(pEnum, ppLong) *(ppLong) = (long *) (pEnum)")
  811. cpp_quote("#define FUNCKIND_from_xmit(pLong, pEnum) *(pEnum) = (FUNCKIND) *(pLong)")
  812. cpp_quote("#define FUNCKIND_free_inst(pEnum) ")
  813. cpp_quote("#define FUNCKIND_free_xmit(pLong) ")
  814.  
  815.  
  816. typedef [transmit_as(long)] enum tagINVOKEKIND {
  817.     INVOKE_FUNC = 1,
  818.     INVOKE_PROPERTYGET = 2,
  819.     INVOKE_PROPERTYPUT = 4,
  820.     INVOKE_PROPERTYPUTREF = 8
  821. } INVOKEKIND;
  822. cpp_quote("#define INVOKEKIND_to_xmit(pEnum, ppLong) *(ppLong) = (long *) (pEnum)")
  823. cpp_quote("#define INVOKEKIND_from_xmit(pLong, pEnum) *(pEnum) = (INVOKEKIND) *(pLong)")
  824. cpp_quote("#define INVOKEKIND_free_inst(pEnum) ")
  825. cpp_quote("#define INVOKEKIND_free_xmit(pLong) ")
  826.  
  827.  
  828. typedef struct tagFUNCDESC {
  829.     MEMBERID memid;
  830.     [size_is(cScodes)] SCODE * lprgscode;
  831.     [size_is(cParams)] ELEMDESC * lprgelemdescParam;  /* array of parameter types */
  832.     FUNCKIND funckind;
  833.     INVOKEKIND invkind;
  834.     CALLCONV callconv;
  835.     SHORT cParams;
  836.     SHORT cParamsOpt;
  837.     SHORT oVft;
  838.     SHORT cScodes;
  839.     ELEMDESC elemdescFunc;
  840.     WORD wFuncFlags;
  841. } FUNCDESC, * LPFUNCDESC;
  842.  
  843.  
  844. typedef [transmit_as(long)] enum tagVARKIND {
  845.     VAR_PERINSTANCE,
  846.     VAR_STATIC,
  847.     VAR_CONST,
  848.     VAR_DISPATCH
  849. } VARKIND;
  850. cpp_quote("#define VARKIND_to_xmit(pEnum, ppLong) *(ppLong) = (long *) (pEnum)")
  851. cpp_quote("#define VARKIND_from_xmit(pLong, pEnum) *(pEnum) = (VARKIND) *(pLong)")
  852. cpp_quote("#define VARKIND_free_inst(pEnum) ")
  853. cpp_quote("#define VARKIND_free_xmit(pLong) ")
  854.  
  855.  
  856.  
  857. /* IMPLTYPE Flags */
  858. const USHORT IMPLTYPEFLAG_FDEFAULT = 0x1;
  859. const USHORT IMPLTYPEFLAG_FSOURCE  = 0x2;
  860. const USHORT IMPLTYPEFLAG_FRESTRICTED  = 0x4;
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867. typedef struct tagVARDESC {
  868.     MEMBERID memid;
  869.     LPOLESTR lpstrSchema;
  870.     [switch_type(unsigned short), switch_is((unsigned short)varkind)]
  871.     union
  872.     {
  873.       [case(VAR_PERINSTANCE)] ULONG oInst;      /* VAR_PERINSTANCE - the offset of this
  874.                    variable within the instance */
  875.       [case(VAR_CONST)] VARIANT * lpvarValue;  /* VAR_CONST - the value of the constant */
  876.     };
  877.     ELEMDESC elemdescVar;
  878.     WORD wVarFlags;
  879.     VARKIND varkind;
  880. } VARDESC, * LPVARDESC;
  881.  
  882.  
  883. cpp_quote("#ifndef _tagTYPEFLAGS_DEFINED")
  884. cpp_quote("#define _tagTYPEFLAGS_DEFINED")
  885. cpp_quote("#define _TYPEFLAGS_DEFINED")
  886. typedef enum tagTYPEFLAGS {
  887.       TYPEFLAG_FAPPOBJECT = 0x01
  888.     , TYPEFLAG_FCANCREATE = 0x02
  889.     , TYPEFLAG_FLICENSED = 0x04
  890.     , TYPEFLAG_FPREDECLID = 0x08
  891.     , TYPEFLAG_FHIDDEN = 0x10
  892.     , TYPEFLAG_FCONTROL = 0x20
  893.     , TYPEFLAG_FDUAL = 0x40
  894.     , TYPEFLAG_FNONEXTENSIBLE = 0x80
  895.     , TYPEFLAG_FOLEAUTOMATION = 0x100
  896.     , TYPEFLAG_FRESTRICTED = 0x200
  897. #ifdef _MAC
  898.     , TYPEFLAG_FORCELONG  = 2147483647
  899. #endif
  900. } TYPEFLAGS;
  901. cpp_quote("#endif")
  902.  
  903.  
  904.  
  905. cpp_quote("#ifndef _tagFUNCFLAGS_DEFINED")
  906. cpp_quote("#define _tagFUNCFLAGS_DEFINED")
  907. cpp_quote("#define _FUNCFLAGS_DEFINED")
  908. typedef enum tagFUNCFLAGS {
  909.       FUNCFLAG_FRESTRICTED= 1
  910.       , FUNCFLAG_FSOURCE= 0x2
  911.       , FUNCFLAG_FBINDABLE= 0x4
  912.       , FUNCFLAG_FREQUESTEDIT= 0x8
  913.       , FUNCFLAG_FDISPLAYBIND= 0x10
  914.       , FUNCFLAG_FDEFAULTBIND= 0x20
  915.       , FUNCFLAG_FHIDDEN= 0x40
  916.       , FUNCFLAG_FUSESGETLASTERROR= 0x80
  917. #ifdef _MAC
  918.     , FUNCFLAG_FORCELONG  = 2147483647
  919. #endif
  920. } FUNCFLAGS;
  921. cpp_quote("#endif")
  922.  
  923.  
  924. cpp_quote("#ifndef _tagVARFLAGS_DEFINED")
  925. cpp_quote("#define _tagVARFLAGS_DEFINED")
  926. cpp_quote("#define _VARFLAGS_DEFINED")
  927. typedef enum tagVARFLAGS {
  928.       VARFLAG_FREADONLY = 1
  929.       , VARFLAG_FSOURCE= 0x2
  930.       , VARFLAG_FBINDABLE= 0x4
  931.       , VARFLAG_FREQUESTEDIT= 0x8
  932.       , VARFLAG_FDISPLAYBIND= 0x10
  933.       , VARFLAG_FDEFAULTBIND= 0x20
  934.       , VARFLAG_FHIDDEN = 0x40
  935. #ifdef _MAC
  936.     , VARFLAG_FORCELONG   = 2147483647
  937. #endif
  938. } VARFLAGS;
  939. cpp_quote("#endif")
  940. }
  941. [
  942.     object,
  943.     uuid(00020405-0000-0000-C000-000000000046),
  944.     pointer_default(unique),
  945.     local  /* marshalling supplied by oleaut32.dll */
  946. ]
  947.  
  948. interface ICreateTypeInfo: IUnknown
  949. {
  950.  
  951.     typedef [unique] ICreateTypeInfo *LPCREATETYPEINFO;
  952.  
  953.  
  954.  
  955.     HRESULT SetGuid(
  956.                      [in] REFGUID guid
  957.                    );
  958.  
  959.     HRESULT SetTypeFlags(
  960.                         [in]   UINT uTypeFlags
  961.                         );
  962.  
  963.     HRESULT SetDocString(
  964.                         [in] LPOLESTR lpstrDoc
  965.                         );
  966.  
  967.     HRESULT SetHelpContext(
  968.                         [in] DWORD dwHelpContext
  969.                           );
  970.  
  971.     HRESULT SetVersion(
  972.                         [in] WORD wMajorVerNum,
  973.                         [in] WORD wMinorVerNum
  974.                       );
  975.  
  976.     HRESULT AddRefTypeInfo(
  977.  
  978.                         [in] ITypeInfo * ptinfo,
  979.                         [in] HREFTYPE * phreftype
  980.                           );
  981.  
  982.     HRESULT AddFuncDesc(
  983.                         [in] UINT index,
  984.                         [in] FUNCDESC * pfuncdesc
  985.                        );
  986.  
  987.     HRESULT AddImplType(
  988.                         [in] UINT index,
  989.                         [in] HREFTYPE hreftype
  990.                        );
  991.  
  992.     HRESULT SetImplTypeFlags(
  993.                         [in] UINT index,
  994.                         [in] INT impltypeflags
  995.                             );
  996.  
  997.     HRESULT SetAlignment(
  998.                         [in] WORD cbAlignment
  999.                         );
  1000.  
  1001.     HRESULT SetSchema(
  1002.                         [in] LPOLESTR lpstrSchema
  1003.                      );
  1004.  
  1005.     HRESULT AddVarDesc(
  1006.                         [in]  UINT index,
  1007.                         [in]  VARDESC * pvardesc
  1008.                       );
  1009.  
  1010.     HRESULT SetFuncAndParamNames(
  1011.                                  [in]  UINT index,
  1012.             [in, size_is((long) cNames)]
  1013.                                  [in]  LPOLESTR * rgszNames,
  1014.                                  [in]  UINT cNames
  1015.                                );
  1016.  
  1017.     HRESULT SetVarName(
  1018.                         [in] UINT index,
  1019.                         [in] LPOLESTR szName
  1020.                       );
  1021.  
  1022.     HRESULT SetTypeDescAlias(
  1023.                               [in]  TYPEDESC * ptdescAlias
  1024.                             );
  1025.  
  1026.     HRESULT DefineFuncAsDllEntry(
  1027.                                  [in] UINT index,
  1028.                                  [in] LPOLESTR szDllName,
  1029.                                  [in] LPOLESTR szProcName
  1030.          );
  1031.  
  1032.     HRESULT SetFuncDocString(
  1033.                               [in] UINT index,
  1034.                               [in] LPOLESTR szDocString
  1035.          );
  1036.  
  1037.     HRESULT SetVarDocString(
  1038.                               [in] UINT index,
  1039.                               [in] LPOLESTR szDocString
  1040.                            );
  1041.  
  1042.     HRESULT SetFuncHelpContext(
  1043.                               [in] UINT index,
  1044.                               [in] DWORD dwHelpContext
  1045.          );
  1046.  
  1047.     HRESULT SetVarHelpContext(
  1048.                               [in] UINT index,
  1049.                               [in] DWORD dwHelpContext
  1050.          );
  1051.  
  1052.     HRESULT SetMops(
  1053.                               [in] UINT index,
  1054.                               [in] BSTR bstrMops
  1055.          );
  1056.  
  1057.     HRESULT SetTypeIdldesc(
  1058.                               [in] IDLDESC * pidldesc
  1059.          );
  1060.  
  1061.     HRESULT LayOut(
  1062.                      void
  1063.                   );
  1064.  
  1065. }
  1066.  
  1067.  
  1068.  
  1069.  
  1070. [
  1071.     object,
  1072.     uuid(00020406-0000-0000-C000-000000000046),
  1073.     pointer_default(unique),
  1074.     local  /* marshalling supplied by oleaut32.dll */
  1075. ]
  1076.  
  1077. interface ICreateTypeLib : IUnknown
  1078. {
  1079.  
  1080.     typedef [unique] ICreateTypeLib *LPCREATETYPELIB;
  1081.  
  1082.  
  1083.     HRESULT CreateTypeInfo(
  1084.                             [in]  LPOLESTR szName,
  1085.                             [in]  TYPEKIND tkind,
  1086.                             [out] ICreateTypeInfo **lplpictinfo
  1087.                            );
  1088.  
  1089.     HRESULT SetName( LPOLESTR szName);
  1090.  
  1091.     HRESULT SetVersion
  1092.     (
  1093.         [in] WORD wMajorVerNum,
  1094.         [in] WORD wMinorVerNum
  1095.     );
  1096.  
  1097.  
  1098.  
  1099.  
  1100.     HRESULT SetGuid
  1101.     (
  1102.         [in] REFGUID guid
  1103.     );
  1104.  
  1105.     HRESULT SetDocString
  1106.     (
  1107.         [in] LPOLESTR szDoc
  1108.     );
  1109.  
  1110.  
  1111.     HRESULT SetHelpFileName
  1112.     (
  1113.         [in] LPOLESTR szHelpFileName
  1114.     );
  1115.  
  1116.     HRESULT SetHelpContext
  1117.     (
  1118.         [in] DWORD dwHelpContext
  1119.     );
  1120.  
  1121.     HRESULT SetLcid
  1122.     (
  1123.         [in] LCID lcid
  1124.     );
  1125.  
  1126.     HRESULT SetLibFlags
  1127.     (
  1128.         [in] UINT uLibFlags
  1129.     );
  1130.  
  1131.  
  1132.     HRESULT SaveAllChanges
  1133.     (
  1134.         void
  1135.     );
  1136.  
  1137. }
  1138.  
  1139. [
  1140.     object,
  1141.     uuid(00020400-0000-0000-C000-000000000046),
  1142.     pointer_default(unique),
  1143.     local  /* marshalling supplied by oleaut32.dll */
  1144. ]
  1145.  
  1146. interface IDispatch : IUnknown
  1147. {
  1148.  
  1149.     typedef [unique] IDispatch *LPDISPATCH;
  1150.  
  1151.     HRESULT GetTypeInfoCount
  1152.     (
  1153.         [out] UINT *pctinfo
  1154.     );
  1155.  
  1156.     HRESULT GetTypeInfo
  1157.     (
  1158.         [in] UINT itinfo,
  1159.         [in] LCID lcid,
  1160.         [out] ITypeInfo ** pptinfo
  1161.     );
  1162.  
  1163.     HRESULT GetIDsOfNames
  1164.     (
  1165.         [in] REFIID riid,
  1166.         [in, size_is(cNames)] LPOLESTR *rgszNames,
  1167.         [in] UINT cNames,
  1168.         [in] LCID lcid,
  1169.         [in, out, size_is(cNames)] DISPID *rgdispid
  1170.     );
  1171.  
  1172.     HRESULT Invoke
  1173.     (
  1174.         [in] DISPID dispidMember,
  1175.         [in] REFIID riid,
  1176.         [in] LCID lcid,
  1177.         [in] WORD wFlags,
  1178.         [in, unique] DISPPARAMS *pdispparams,
  1179.         [in, out, unique] VARIANT *pvarResult,
  1180.         [out] EXCEPINFO *pexcepinfo,
  1181.         [out] UINT *puArgErr
  1182.     );
  1183.  
  1184. cpp_quote("/* DISPID reserved to indicate an \"unknown\" name */")
  1185. cpp_quote("/* only reserved for data members (properties); reused as a method dispid below */")
  1186.    const DISPID DISPID_UNKNOWN       = -1;
  1187.  
  1188. cpp_quote("/* DISPID reserved for the \"value\" property */")
  1189.    const DISPID DISPID_VALUE         = 0;
  1190.  
  1191. cpp_quote("/* The following DISPID is reserved to indicate the param")
  1192. cpp_quote(" * that is the right-hand-side (or \"put\" value) of a PropertyPut")
  1193. cpp_quote(" */")
  1194. const DISPID DISPID_PROPERTYPUT = -3;
  1195.  
  1196. cpp_quote("/* DISPID reserved for the standard \"NewEnum\" method */")
  1197. const DISPID DISPID_NEWENUM  = -4;
  1198.  
  1199. cpp_quote("/* DISPID reserved for the standard \"Evaluate\" method */")
  1200. const DISPID DISPID_EVALUATE = -5;
  1201.  
  1202. const DISPID DISPID_CONSTRUCTOR = -6;
  1203.  
  1204. const DISPID DISPID_DESTRUCTOR = -7;
  1205.  
  1206. const DISPID DISPID_COLLECT = -8;
  1207.  
  1208. cpp_quote("/* The range -500 through -999 is reserved for Controls */")
  1209. cpp_quote("/* The range 0x80010000 through 0x8001FFFF is reserved for Controls */")
  1210. cpp_quote("/* The remainder of the negative DISPIDs are reserved for future use */")
  1211.  
  1212. }
  1213.  
  1214. [
  1215.     object,
  1216.     local,
  1217.     uuid(00020404-0000-0000-C000-000000000046),
  1218.     pointer_default(unique)
  1219. ]
  1220.  
  1221. interface IEnumVARIANT : IUnknown
  1222. {
  1223.  
  1224.     typedef [unique] IEnumVARIANT* LPENUMVARIANT;
  1225.  
  1226.  
  1227.     HRESULT Next(
  1228.         [in] unsigned long celt,
  1229.     [out] VARIANT *rgvar,
  1230.     [out] unsigned long *pceltFetched);
  1231.  
  1232.     HRESULT Skip(
  1233.     [in] unsigned long celt);
  1234.  
  1235.     HRESULT Reset();
  1236.  
  1237.     HRESULT Clone(
  1238.     [out] IEnumVARIANT** ppenum);
  1239.  
  1240. }
  1241.  
  1242. [
  1243.     object,
  1244.     uuid(00020403-0000-0000-C000-000000000046),
  1245.     pointer_default(unique),
  1246.     local  /* marshalling supplied by oleaut32.dll */
  1247. ]
  1248.  
  1249. interface ITypeComp : IUnknown
  1250. {
  1251.  
  1252.     typedef [unique] ITypeComp *LPTYPECOMP;
  1253.  
  1254.     typedef [v1_enum] enum tagDESCKIND
  1255.     {
  1256.         DESCKIND_NONE = 0,
  1257.         DESCKIND_FUNCDESC,
  1258.         DESCKIND_VARDESC,
  1259.         DESCKIND_TYPECOMP,
  1260.         DESCKIND_IMPLICITAPPOBJ,
  1261.         DESCKIND_MAX
  1262.     } DESCKIND;
  1263.  
  1264.     cpp_quote("#define DESCKIND_to_xmit(pEnum, ppLong) *(ppLong) = (long *) (pEnum)")
  1265.     cpp_quote("#define DESCKIND_from_xmit(pLong, pEnum) *(pEnum) = (DESCKIND) *(pLong)")
  1266.     cpp_quote("#define DESCKIND_free_inst(pEnum) ")
  1267.     cpp_quote("#define DESCKIND_free_xmit(pLong) ")
  1268.  
  1269.     [switch_type(long)] union tagBINDPTR
  1270.     {
  1271.     [case(DESCKIND_FUNCDESC)]
  1272.         FUNCDESC *lpfuncdesc;
  1273.  
  1274.     [case(DESCKIND_VARDESC)]
  1275.         VARDESC *lpvardesc;
  1276.  
  1277.     [case(DESCKIND_TYPECOMP)]
  1278.         [unique] ITypeComp *lptcomp;
  1279.  
  1280.     [default]
  1281.         ;
  1282.     };
  1283.  
  1284.     typedef union tagBINDPTR BINDPTR;
  1285.     typedef BINDPTR *LPBINDPTR;
  1286.  
  1287.     HRESULT Bind
  1288.     (
  1289.         [in] LPOLESTR szName,
  1290.         [in] ULONG lHashVal,
  1291.         [in] WORD fFlags,
  1292.         [out] ITypeInfo **pptinfo,
  1293.         [out] DESCKIND *pdesckind,
  1294.         [out, switch_is((long) *pdesckind)] BINDPTR *pbindptr
  1295.     );
  1296.  
  1297.     HRESULT BindType
  1298.     (
  1299.         [in] LPOLESTR szName,
  1300.         [in] ULONG lHashVal,
  1301.         [out] ITypeInfo **pptinfo,
  1302.         [out] ITypeComp **pptcomp
  1303.     );
  1304. }
  1305.  
  1306. [
  1307.     object,
  1308.     uuid(00020401-0000-0000-C000-000000000046),
  1309.     pointer_default(unique),
  1310.     local  /* marshalling supplied by oleaut32.dll */
  1311. ]
  1312.  
  1313. interface ITypeInfo : IUnknown
  1314. {
  1315.  
  1316.     typedef [unique] ITypeInfo *LPTYPEINFO;
  1317.  
  1318. /*---------------------------------------------------------------------*/
  1319. /*                            ITypeInfo                                */
  1320. /*---------------------------------------------------------------------*/
  1321.  
  1322.     HRESULT GetTypeAttr
  1323.     (
  1324.         [out] TYPEATTR **pptypeattr
  1325.     );
  1326.  
  1327.     HRESULT GetTypeComp
  1328.     (
  1329.         [out] ITypeComp **pptcomp
  1330.     );
  1331.  
  1332.     HRESULT GetFuncDesc
  1333.     (
  1334.         [in] UINT index,
  1335.         [out] FUNCDESC **pppfuncdesc
  1336.     );
  1337.  
  1338.     HRESULT GetVarDesc
  1339.     (
  1340.         [in] UINT index,
  1341.         [out] VARDESC **ppvardesc
  1342.     );
  1343.  
  1344.     HRESULT GetNames
  1345.     (
  1346.         [in] MEMBERID memid,
  1347.         [out, size_is(cMaxNames), length_is(*pcNames)] BSTR *rgbstrNames,
  1348.         [in] UINT cMaxNames,
  1349.         [out] UINT *pcNames
  1350.     );
  1351.  
  1352.  
  1353.     HRESULT GetRefTypeOfImplType
  1354.     (
  1355.         [in] UINT index,
  1356.         [out] HREFTYPE *hpreftype
  1357.     );
  1358.  
  1359.  
  1360.     HRESULT GetImplTypeFlags
  1361.     (
  1362.         [in] UINT index,
  1363.         [out] INT * pimpltypeflags
  1364.     );
  1365.  
  1366.  
  1367.  
  1368.     HRESULT GetIDsOfNames
  1369.     (
  1370.         [in, size_is(cNames)] OLECHAR **rglpszNames,
  1371.         [in] UINT cNames,
  1372.         [out, size_is(cNames)] MEMBERID *rgmemid
  1373.     );
  1374.  
  1375.     HRESULT Invoke
  1376.     (
  1377.     [in, unique] void *pvInstance,
  1378.         [in] MEMBERID memid,
  1379.         [in] WORD wFlags,
  1380.         [in] DISPPARAMS *pdispparams,
  1381.         [out] VARIANT *pvarResult,
  1382.         [out] EXCEPINFO *pexcepinfo,
  1383.         [out] UINT *puArgErr
  1384.     );
  1385.  
  1386.     HRESULT GetDocumentation
  1387.     (
  1388.         [in] MEMBERID memid,
  1389.         [out] BSTR *pbstrName,
  1390.         [out] BSTR *pbstrDocString,
  1391.         [out] DWORD *pdwHelpContext,
  1392.         [out] BSTR * pbstrHelpFile
  1393.     );
  1394.  
  1395.     HRESULT GetDllEntry
  1396.     (
  1397.         [in] MEMBERID memid,
  1398.         [in] INVOKEKIND invkind,
  1399.         [out] BSTR *pbstrDllName,
  1400.         [out] BSTR *pbstrName,
  1401.         [out] WORD *pwOrdinal
  1402.     );
  1403.  
  1404.     HRESULT GetRefTypeInfo
  1405.     (
  1406.         [in] HREFTYPE hreftype,
  1407.         [out] ITypeInfo ** pptinfo
  1408.     );
  1409.  
  1410.     HRESULT __stdcall AddressOfMember
  1411.     (
  1412.         [in] MEMBERID memid,
  1413.         [in] INVOKEKIND invkind,
  1414.         [out] void **ppv
  1415.     );
  1416.  
  1417.     HRESULT CreateInstance
  1418.     (
  1419.         [in] IUnknown * puncOuter,
  1420.         [in] REFIID riid,
  1421.         [out] void **ppvObj
  1422.     );
  1423.  
  1424.     HRESULT GetMops
  1425.     (
  1426.         [in] MEMBERID memid,
  1427.         [out] BSTR *pbstrMops
  1428.     );
  1429.  
  1430.     HRESULT GetContainingTypeLib
  1431.     (
  1432.         [out] ITypeLib **pptlib,
  1433.         [out] UINT *pindex
  1434.     );
  1435.  
  1436.     void ReleaseTypeAttr
  1437.     (
  1438.         [in] TYPEATTR *ptypeattr
  1439.     );
  1440.  
  1441.     void ReleaseFuncDesc
  1442.     (
  1443.         [in] FUNCDESC *pfuncdesc
  1444.     );
  1445.  
  1446.     void ReleaseVarDesc
  1447.     (
  1448.         [in] VARDESC *pvardesc
  1449.     );
  1450. }
  1451.  
  1452. [
  1453.     object,
  1454.     uuid(00020402-0000-0000-C000-000000000046),
  1455.     pointer_default(unique),
  1456.     local  /* marshalling supplied by oleaut32.dll */
  1457.  
  1458. ]
  1459.  
  1460. interface ITypeLib : IUnknown
  1461. {
  1462.  
  1463.     typedef [transmit_as(long)] enum tagSYSKIND
  1464.     {
  1465.         SYS_WIN16 = 0,
  1466.         SYS_WIN32,
  1467.         SYS_MAC
  1468.     } SYSKIND;
  1469.  
  1470.  
  1471.     typedef [transmit_as(long)] enum tagLIBFLAGS
  1472.     {
  1473.       LIBFLAG_FRESTRICTED = 0x01
  1474.       , LIBFLAG_FCONTROL = 0x02
  1475.       , LIBFLAG_FHIDDEN = 0x04
  1476.     } LIBFLAGS;
  1477.  
  1478.     // macros to work around a casting problem with midl generated code
  1479.     // and to preserve all 32-bits of the enum value
  1480.     //
  1481.     cpp_quote("#define SYSKIND_to_xmit(pEnum, ppLong) *(ppLong) = (long *) (pEnum)")
  1482.     cpp_quote("#define SYSKIND_from_xmit(pLong, pEnum) *(pEnum) = (SYSKIND) *(pLong)")
  1483.     cpp_quote("#define SYSKIND_free_inst(pEnum) ")
  1484.     cpp_quote("#define SYSKIND_free_xmit(pLong) ")
  1485.  
  1486.  
  1487.     typedef [unique] ITypeLib *LPTYPELIB;
  1488.  
  1489.     typedef struct tagTLIBATTR
  1490.     {
  1491.         GUID guid;
  1492.         LCID lcid;
  1493.         SYSKIND syskind;
  1494.         WORD wMajorVerNum;
  1495.         WORD wMinorVerNum;
  1496.         WORD wLibFlags;
  1497.     } TLIBATTR;
  1498.  
  1499.     typedef TLIBATTR *LPTLIBATTR;
  1500.  
  1501.     UINT GetTypeInfoCount
  1502.     (
  1503.         void
  1504.     );
  1505.  
  1506.     HRESULT GetTypeInfo
  1507.     (
  1508.         [in] UINT index,
  1509.         [out] ITypeInfo **ppitinfo
  1510.     );
  1511.  
  1512.     HRESULT GetTypeInfoType
  1513.     (
  1514.         [in] UINT index,
  1515.         [out] TYPEKIND * ptkind
  1516.     );
  1517.  
  1518.     HRESULT GetTypeInfoOfGuid
  1519.     (
  1520.         [in] REFGUID guid,
  1521.         [out] ITypeInfo **pptinfo
  1522.     );
  1523.  
  1524.     HRESULT GetLibAttr
  1525.     (
  1526.         [out] TLIBATTR **pptlibattr
  1527.     );
  1528.  
  1529.     HRESULT GetTypeComp
  1530.     (
  1531.         [out] ITypeComp **pptcomp
  1532.     );
  1533.  
  1534.     HRESULT GetDocumentation
  1535.     (
  1536.         [in] INT index,
  1537.         [out] BSTR *pbstrName,
  1538.         [out] BSTR *pbstrDocString,
  1539.         [out] DWORD *pdwHelpContext,
  1540.         [out] BSTR *pbstrHelpFile
  1541.     );
  1542.  
  1543.     HRESULT IsName
  1544.     (
  1545.         [in] LPOLESTR szNameBuf,
  1546.         [in] ULONG lHashVal,
  1547.         [out] BOOL *pfName
  1548.     );
  1549.  
  1550.     HRESULT FindName
  1551.     (
  1552.         [in] LPOLESTR szNameBuf,
  1553.         [in] ULONG lHashVal,
  1554.         [out, size_is(*pcFound), length_is(*pcFound)] ITypeInfo ** rgptinfo,
  1555.         [out, size_is(*pcFound), length_is(*pcFound)] MEMBERID * rgmemid,
  1556.         [in, out] USHORT *pcFound
  1557.     );
  1558.  
  1559.     void ReleaseTLibAttr
  1560.     (
  1561.         [in] TLIBATTR *ptlibattr
  1562.     );
  1563.  
  1564. }
  1565.  
  1566. [
  1567.     object,
  1568.     uuid(1CF2B120-547D-101B-8E65-08002B2BD119),
  1569.     pointer_default(unique),
  1570.     local  /* marshalling supplied by oleaut32.dll */
  1571. ]
  1572.  
  1573. interface IErrorInfo: IUnknown
  1574. {
  1575.  
  1576.     typedef [unique] IErrorInfo *LPERRORINFO;
  1577.  
  1578.     HRESULT GetGUID(
  1579.                      [out] GUID FAR* pguid
  1580.                    );
  1581.  
  1582.     HRESULT GetSource(
  1583.                      [out] BSTR FAR* pbstrSource
  1584.                    );
  1585.  
  1586.     HRESULT GetDescription(
  1587.                      [out] BSTR FAR* pbstrDescription
  1588.                    );
  1589.  
  1590.     HRESULT GetHelpFile(
  1591.                      [out] BSTR FAR* pbstrHelpFile
  1592.                    );
  1593.  
  1594.     HRESULT GetHelpContext(
  1595.                      [out] DWORD FAR* pdwHelpContext
  1596.                    );
  1597.  
  1598. }
  1599.  
  1600. [
  1601.     object,
  1602.     uuid(22F03340-547D-101B-8E65-08002B2BD119),
  1603.     pointer_default(unique),
  1604.     local  /* marshalling supplied by oleaut32.dll */
  1605. ]
  1606.  
  1607. interface ICreateErrorInfo: IUnknown
  1608. {
  1609.  
  1610.     typedef [unique] ICreateErrorInfo *LPCREATEERRORINFO;
  1611.  
  1612.     HRESULT SetGUID(
  1613.                      [in] REFGUID rguid
  1614.                    );
  1615.  
  1616.     HRESULT SetSource(
  1617.                      [in] LPOLESTR szSource
  1618.                    );
  1619.  
  1620.     HRESULT SetDescription(
  1621.                      [in] LPOLESTR szDescription
  1622.                    );
  1623.  
  1624.     HRESULT SetHelpFile(
  1625.                      [in] LPOLESTR szHelpFile
  1626.                    );
  1627.  
  1628.     HRESULT SetHelpContext(
  1629.                      [in] DWORD dwHelpContext
  1630.                    );
  1631.  
  1632. }
  1633.  
  1634. [
  1635.     object,
  1636.     uuid(DF0B3D60-548F-101B-8E65-08002B2BD119),
  1637.     pointer_default(unique),
  1638.     local  /* marshalling supplied by oleaut32.dll */
  1639. ]
  1640.  
  1641. interface ISupportErrorInfo: IUnknown
  1642. {
  1643.  
  1644.     typedef [unique] ISupportErrorInfo *LPSUPPORTERRORINFO;
  1645.  
  1646.     HRESULT InterfaceSupportsErrorInfo(
  1647.                      [in] REFIID riid
  1648.                    );
  1649.  
  1650. }
  1651.  
  1652.