Dispex.Idl 11 KB

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