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

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright 1997 - 1998 Microsoft Corporation.
  5. //
  6. //  Contents:   IDispatchEx description
  7. //
  8. //----------------------------------------------------------------------------
  9.  
  10. cpp_quote("//=--------------------------------------------------------------------------=")
  11. cpp_quote("// DispEx.h")
  12. cpp_quote("//=--------------------------------------------------------------------------=")
  13. cpp_quote("// (C) Copyright 1997 - 1998 Microsoft Corporation.  All Rights Reserved.")
  14. cpp_quote("//")
  15. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  16. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  17. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  18. cpp_quote("// PARTICULAR PURPOSE.")
  19. cpp_quote("//=--------------------------------------------------------------------------=")
  20. cpp_quote("")
  21. cpp_quote("#pragma comment(lib,\"uuid.lib\")")
  22. cpp_quote("")
  23. cpp_quote("//---------------------------------------------------------------------------=")
  24. cpp_quote("// IDispatchEx Interfaces.")
  25. cpp_quote("//")
  26. cpp_quote("")
  27. cpp_quote("#ifndef DISPEX_H_")
  28. cpp_quote("#define DISPEX_H_")
  29. cpp_quote("")
  30.  
  31. interface IDispatchEx;
  32. interface IDispError;
  33. interface IVariantChangeType;
  34.  
  35. #ifndef DO_NO_IMPORTS
  36. import "ocidl.idl";
  37. import "oleidl.idl";
  38. import "oaidl.idl";
  39. import "servprov.idl";
  40. #endif
  41.  
  42. cpp_quote("")
  43. cpp_quote("#ifndef _NO_DISPATCHEX_GUIDS")
  44. cpp_quote("")
  45. cpp_quote("// {A6EF9860-C720-11d0-9337-00A0C90DCAA9}")
  46. cpp_quote("DEFINE_GUID(IID_IDispatchEx, 0xa6ef9860, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  47. cpp_quote("")
  48. cpp_quote("// {A6EF9861-C720-11d0-9337-00A0C90DCAA9}")
  49. cpp_quote("DEFINE_GUID(IID_IDispError, 0xa6ef9861, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  50. cpp_quote("")
  51. cpp_quote("// {A6EF9862-C720-11d0-9337-00A0C90DCAA9}")
  52. cpp_quote("DEFINE_GUID(IID_IVariantChangeType, 0xa6ef9862, 0xc720, 0x11d0, 0x93, 0x37, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  53. cpp_quote("")
  54. cpp_quote("// {1F101481-BCCD-11d0-9336-00A0C90DCAA9}")
  55. cpp_quote("DEFINE_GUID(SID_VariantConversion, 0x1f101481, 0xbccd, 0x11d0, 0x93, 0x36, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  56. cpp_quote("")
  57. cpp_quote("// {4717CC40-BCB9-11d0-9336-00A0C90DCAA9}")
  58. cpp_quote("DEFINE_GUID(SID_GetCaller, 0x4717cc40, 0xbcb9, 0x11d0, 0x93, 0x36, 0x0, 0xa0, 0xc9, 0xd, 0xca, 0xa9);")
  59. cpp_quote("")
  60. cpp_quote("// {CA04B7E6-0D21-11d1-8CC5-00C04FC2B085}")
  61. cpp_quote("DEFINE_GUID(IID_IObjectIdentity, 0xca04b7e6, 0xd21, 0x11d1, 0x8c, 0xc5, 0x0, 0xc0, 0x4f, 0xc2, 0xb0, 0x85);")
  62. cpp_quote("")
  63. cpp_quote("#define SID_GetScriptSite IID_IActiveScriptSite")
  64. cpp_quote("")
  65. cpp_quote("#endif // _NO_DISPATCHEX_GUIDS")
  66. cpp_quote("")
  67.  
  68. cpp_quote("")
  69. cpp_quote("#ifndef _NO_DISPATCHEX_CONSTS")
  70. cpp_quote("")
  71. cpp_quote("// Input flags for GetDispID")
  72. cpp_quote("#define fdexNameCaseSensitive       0x00000001L")
  73. cpp_quote("#define fdexNameEnsure              0x00000002L")
  74. cpp_quote("#define fdexNameImplicit            0x00000004L")
  75. cpp_quote("#define fdexNameCaseInsensitive     0x00000008L")
  76. cpp_quote("")
  77. cpp_quote("// Output flags for GetMemberProperties")
  78. cpp_quote("#define fdexPropCanGet              0x00000001L")
  79. cpp_quote("#define fdexPropCannotGet           0x00000002L")
  80. cpp_quote("#define fdexPropCanPut              0x00000004L")
  81. cpp_quote("#define fdexPropCannotPut           0x00000008L")
  82. cpp_quote("#define fdexPropCanPutRef           0x00000010L")
  83. cpp_quote("#define fdexPropCannotPutRef        0x00000020L")
  84. cpp_quote("#define fdexPropNoSideEffects       0x00000040L")
  85. cpp_quote("#define fdexPropDynamicType         0x00000080L")
  86. cpp_quote("#define fdexPropCanCall             0x00000100L")
  87. cpp_quote("#define fdexPropCannotCall          0x00000200L")
  88. cpp_quote("#define fdexPropCanConstruct        0x00000400L")
  89. cpp_quote("#define fdexPropCannotConstruct     0x00000800L")
  90. cpp_quote("#define fdexPropCanSourceEvents     0x00001000L")
  91. cpp_quote("#define fdexPropCannotSourceEvents  0x00002000L")
  92. cpp_quote("")
  93. cpp_quote("#define grfdexPropCanAll \\")
  94. cpp_quote("       (fdexPropCanGet | fdexPropCanPut | fdexPropCanPutRef | \\")
  95. cpp_quote("        fdexPropCanCall | fdexPropCanConstruct | fdexPropCanSourceEvents)")
  96. cpp_quote("#define grfdexPropCannotAll \\")
  97. cpp_quote("       (fdexPropCannotGet | fdexPropCannotPut | fdexPropCannotPutRef | \\")
  98. cpp_quote("        fdexPropCannotCall | fdexPropCannotConstruct | fdexPropCannotSourceEvents)")
  99. cpp_quote("#define grfdexPropExtraAll \\")
  100. cpp_quote("       (fdexPropNoSideEffects | fdexPropDynamicType)")
  101. cpp_quote("#define grfdexPropAll \\")
  102. cpp_quote("       (grfdexPropCanAll | grfdexPropCannotAll | grfdexPropExtraAll)")
  103. cpp_quote("")
  104. cpp_quote("// Input flags for GetNextDispID")
  105. cpp_quote("#define fdexEnumDefault             0x00000001L")
  106. cpp_quote("#define fdexEnumAll                 0x00000002L")
  107. cpp_quote("")
  108. cpp_quote("// Additional flags for Invoke - when object member is")
  109. cpp_quote("// used as a constructor.")
  110. cpp_quote("#define DISPATCH_CONSTRUCT 0x4000")
  111. cpp_quote("")
  112. cpp_quote("// Standard DISPIDs")
  113. cpp_quote("#define DISPID_THIS (-613)")
  114. cpp_quote("#define DISPID_STARTENUM DISPID_UNKNOWN")
  115. cpp_quote("")
  116. cpp_quote("#endif //_NO_DISPATCHEX_CONSTS")
  117. cpp_quote("")
  118.  
  119. [
  120.     object,
  121.     uuid(A6EF9860-C720-11d0-9337-00A0C90DCAA9),
  122.     pointer_default(unique)
  123. ]
  124. interface IDispatchEx : IDispatch
  125.     {
  126.     // NOTES:
  127.     // (*) grfdex can contain any subset of the bits
  128.     //     { fdexNameCaseSensitive, fdexNameEnsure, fdexNameImplicit }.
  129.     // (*) pvarInit may be NULL.
  130.     HRESULT GetDispID(
  131.         [in] BSTR bstrName,
  132.         [in] DWORD grfdex,
  133.         [out] DISPID *pid);
  134.  
  135.     // NOTES:
  136.     // (*) pvarRes, pei and pspCaller may be NULL.
  137.     // (*) When DISPATCH_METHOD is set in wFlags, there may be a "named
  138.     //     parameter" for the "this" value. The dispID will be DISPID_THIS and
  139.     //     it must be the first named parameter.
  140.     // (*) There is a new value for wFlags: DISPATCH_CONSTRUCT. This indicates
  141.     //     that the item is being used as a constructor.
  142.     // (*) The legal values for wFlags are:
  143.     //     DISPATCH_PROPERTYGET
  144.     //     DISPATCH_METHOD
  145.     //     DISPATCH_PROPERTYGET | DISPATCH_METHOD
  146.     //     DISPATCH_PROPERTYPUT
  147.     //     DISPATCH_PROPERTYPUTREF
  148.     //     DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF
  149.     //     DISPATCH_CONSTRUCT
  150.     // (*) IDispatchEx::Invoke should support the same values that
  151.     //     IDispatchEx::InvokeEx supports (eg, DISPID_THIS, DISPATCH_CONSTRUCT).
  152.     [local]
  153.     HRESULT InvokeEx(
  154.         [in] DISPID id,
  155.         [in] LCID lcid,
  156.         [in] WORD wFlags,
  157.         [in] DISPPARAMS *pdp,
  158.         [out] VARIANT *pvarRes,    // Can be NULL.
  159.         [out] EXCEPINFO *pei,    // Can be NULL.
  160.         [in, unique] IServiceProvider *pspCaller);
  161.  
  162.     [call_as(InvokeEx)]
  163.     HRESULT RemoteInvokeEx(
  164.         [in] DISPID id,
  165.         [in] LCID lcid,
  166.         [in] DWORD dwFlags,     // Hiword used for private marshalling flags.
  167.         [in] DISPPARAMS *pdp,
  168.         [out] VARIANT *pvarRes,
  169.         [out] EXCEPINFO *pei,
  170.         [in, unique] IServiceProvider *pspCaller,
  171.         [in] UINT cvarRefArg,
  172.         [in, size_is(cvarRefArg)] UINT *rgiRefArg,
  173.         [in, out, size_is(cvarRefArg)] VARIANT *rgvarRefArg);
  174.  
  175.     // NOTES:
  176.     // (*) grfdex can optionally contain the bit fdexNameCaseSensitive.
  177.     // (*) If the member doesn't exist, return S_OK.
  178.     // (*) If the member exists but can't be deleted, return S_FALSE.
  179.     // (*) If the member is deleted, the DISPID still needs to be valid for
  180.     //     GetNextDispID and if a member of the same name is recreated, the
  181.     //     dispID should be the same.
  182.     HRESULT DeleteMemberByName([in] BSTR bstr, [in] DWORD grfdex);
  183.  
  184.     // NOTES:
  185.     // (*) If the member doesn't exist, return S_OK.
  186.     // (*) If the member exists but can't be deleted, return S_FALSE.
  187.     // (*) If the member is deleted, the DISPID still needs to be valid for
  188.     //     GetNextDispID and if a member of the same name is recreated, the
  189.     //     dispID should be the same.
  190.     HRESULT DeleteMemberByDispID([in] DISPID id);
  191.  
  192.     HRESULT GetMemberProperties(
  193.         [in] DISPID id,
  194.         [in] DWORD grfdexFetch,
  195.         [out] DWORD *pgrfdex);
  196.  
  197.     HRESULT GetMemberName(
  198.         [in] DISPID id,
  199.         [out] BSTR *pbstrName);
  200.  
  201.     HRESULT GetNextDispID(
  202.         [in] DWORD grfdex,
  203.         [in] DISPID id,
  204.         [out] DISPID *pid);
  205.  
  206.     HRESULT GetNameSpaceParent([out] IUnknown **ppunk);
  207.     };
  208.  
  209.  
  210. [
  211.     object,
  212.     uuid(A6EF9861-C720-11d0-9337-00A0C90DCAA9),
  213.     pointer_default(unique)
  214. ]
  215. interface IDispError : IUnknown
  216.     {
  217.     HRESULT QueryErrorInfo(
  218.         [in] GUID guidErrorType,
  219.         [out] IDispError **ppde);
  220.  
  221.     HRESULT GetNext([out] IDispError **ppde);
  222.  
  223.     // EXCEPINFO information
  224.     HRESULT GetHresult([out] HRESULT *phr);
  225.     HRESULT GetSource([out] BSTR *pbstrSource);
  226.     HRESULT GetHelpInfo([out] BSTR *pbstrFileName, [out] DWORD *pdwContext);
  227.     HRESULT GetDescription([out] BSTR *pbstrDescription);
  228.     };
  229.  
  230.  
  231. [
  232.     object,
  233.     uuid(A6EF9862-C720-11d0-9337-00A0C90DCAA9),
  234.     pointer_default(unique)
  235. ]
  236. interface IVariantChangeType : IUnknown
  237.     {
  238.     // NOTES:
  239.     // (*) pvarDst and pvarSrc may be equal.
  240.     // (*) pvarDst should be initialized to a valid variant value.
  241.     //     VariantClear will be called on it.
  242.     HRESULT ChangeType(
  243.         [in, out, unique] VARIANT *pvarDst,
  244.         [in, unique] VARIANT *pvarSrc,
  245.         [in] LCID lcid,
  246.         [in] VARTYPE vtNew);
  247.     };
  248.  
  249. [
  250.         object,
  251.         uuid(CA04B7E6-0D21-11d1-8CC5-00C04FC2B085),
  252.         pointer_default(unique)
  253. ]
  254. interface IObjectIdentity : IUnknown
  255. {
  256.         HRESULT IsEqualObject( 
  257.                 [in] IUnknown *punk
  258.         );
  259. };
  260.  
  261. cpp_quote("#endif //DISPEX_H_")
  262.  
  263.