home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Include / Include / javaax.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-04  |  8.3 KB  |  240 lines

  1. /*++
  2.  
  3. Copyright (c) 1995-1999  Microsoft Corporation.  All rights reserved.
  4.  
  5. Module Name:
  6.  
  7.     javaax.h
  8.  
  9. Abstract:
  10.  
  11.     Declarations and definitions for the ActiveX objects and services provided
  12.     by the Microsoft VM.
  13.  
  14. --*/
  15.  
  16. #ifndef _JAVAAX_
  17. #define _JAVAAX_
  18.  
  19.  
  20. #ifndef __midl
  21.  
  22.  
  23. #ifdef __cplusplus
  24. #if _MSC_VER >= 1100
  25. interface __declspec(novtable) IJavaComModuleManager;
  26. interface __declspec(novtable) IPersistJavaTypeLib;
  27. #else
  28. interface IJavaComModuleManager;
  29. interface IPersistJavaTypeLib;
  30. #endif
  31. #else
  32. typedef interface IJavaComModuleManager IJavaComModuleManager;
  33. typedef interface IPersistJavaTypeLib IPersistJavaTypeLib;
  34. #endif
  35.  
  36. //
  37. //  CLSID_StdJavaComModuleManager, IJavaComModuleManager
  38. //
  39.  
  40. #undef  INTERFACE
  41. #define INTERFACE IJavaComModuleManager
  42.  
  43. DECLARE_INTERFACE_(IJavaComModuleManager, IUnknown)
  44. {
  45. #ifndef NO_BASEINTERFACE_FUNCS
  46.     /* IUnknown methods */
  47.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  48.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  49.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  50. #endif
  51.     /* IJavaComModuleManager methods */
  52.     STDMETHOD(GetClassObject)(THIS_ REFCLSID rclsid, HMODULE hModule, DWORD
  53.         dwClsContext, REFIID riid, LPVOID *ppvObj) PURE;
  54.     STDMETHOD(CanUnloadNow)(THIS_ HMODULE hModule) PURE;
  55.     STDMETHOD(OnModuleUnload)(THIS_ HMODULE hModule) PURE;
  56.     STDMETHOD(RunRegistrationCode)(THIS_ REFCLSID rclsid, HMODULE hModule,
  57.         DWORD dwClsContext, BOOL fRegister) PURE;
  58.     STDMETHOD(ExecCommand)(THIS_ REFCLSID rclsid, HMODULE hModule, UINT nCmdID,
  59.         LPVOID lpvCommandData) PURE;
  60. };
  61.  
  62. // {AC680B40-CDA0-11d1-A936-0080C7C575C0}
  63. DEFINE_GUID(IID_IJavaComModuleManager,
  64. 0xac680b40, 0xcda0, 0x11d1, 0xa9, 0x36, 0x0, 0x80, 0xc7, 0xc5, 0x75, 0xc0);
  65.  
  66. // {AC680B41-CDA0-11d1-A936-0080C7C575C0}
  67. DEFINE_GUID(CLSID_StdJavaComModuleManager,
  68. 0xac680b41, 0xcda0, 0x11d1, 0xa9, 0x36, 0x0, 0x80, 0xc7, 0xc5, 0x75, 0xc0);
  69.  
  70. //
  71. //  IPersistJavaTypeLib
  72. //
  73. //  This is the interface that can be used to persist the type information for a
  74. //  Java class to a type library.  This interface can be accessed indirectly
  75. //  through a running Java instance (SDK 2.0+) or directly from the COM class
  76. //  object (SDK 3.0+).  Tools may use this to save type libraries for COM
  77. //  applications which require a physical type library to exist.  If the Java
  78. //  class implements com.ms.com.NoAutoScripting, then this interface may not
  79. //  be available or the Save method may fail.
  80. //
  81. //  Example for SDK 2.0 (error checking removed for simplicity):
  82. //
  83. //      IProvideClassInfo *pci;
  84. //      ITypeInfo *pti;
  85. //      ITypeLib *ptl;
  86. //      IPersistJavaTypeLib *ppjtl;
  87. //
  88. //      punkJavaObject->QueryInterface(IID_IProvideClassInfo, (LPVOID *) &pci);
  89. //      pci->GetClassInfo(&pti);
  90. //      pti->GetContainingTypeLib(&ptl);
  91. //      ptl->QueryInterface(IID_IPersistJavaTypeLib, (LPVOID *) &ppjtl);
  92. //      ppjtl->Save(pctlib);
  93. //
  94. //  Example for SDK 3.0 (error checking removed for simplicity):
  95. //
  96. //      IPersistJavaTypeLib *ppjtl;
  97. //
  98. //      CoGetClassObject(clsid, CLSCTX_INPROC_SERVER, NULL,
  99. //          IID_IPersistJavaTypeLib, (LPVOID *) &ppjtl);
  100. //      ppjtl->Save(pctlib);
  101. //
  102.  
  103. #undef  INTERFACE
  104. #define INTERFACE IPersistJavaTypeLib
  105.  
  106. DECLARE_INTERFACE_(IPersistJavaTypeLib, IUnknown)
  107. {
  108. #ifndef NO_BASEINTERFACE_FUNCS
  109.     /* IUnknown methods */
  110.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  111.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  112.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  113. #endif
  114.     /* IPersistJavaTypeLib methods */
  115.     STDMETHOD(Save)(THIS_ ICreateTypeLib2 *lpctlib) PURE;
  116. };
  117.  
  118. // {3A29ACD0-78D5-11d0-AF77-0080C71F7993}
  119. DEFINE_GUID(IID_IPersistJavaTypeLib,
  120. 0x3a29acd0, 0x78d5, 0x11d0, 0xaf, 0x77, 0x0, 0x80, 0xc7, 0x1f, 0x79, 0x93);
  121.  
  122. //
  123. //  CLSID_BrowserAppletControl
  124. //
  125. //  This is the well-known ActiveX control CLSID that browsers such as Internet
  126. //  Explorer use for hosting applets.
  127. //
  128.  
  129. // {08B0E5C0-4FCB-11CF-AAA5-00401C608501}
  130. DEFINE_GUID(CLSID_BrowserAppletControl,
  131. 0x08B0E5C0L, 0x4FCB, 0x11CF, 0xAA, 0xA5, 0x00, 0x40, 0x1C, 0x60, 0x85, 0x01);
  132.  
  133. //
  134. //  CGID_BrowserAppletControl
  135. //
  136. //  The Browser Applet Control implements IOleCommandTarget with this command
  137. //  group GUID for control specific behavior.
  138. //
  139.  
  140. // {349FC790-0C99-11d2-AA15-0080C7C575C0}
  141. DEFINE_GUID(CGID_BrowserAppletControl,
  142. 0x349fc790, 0xc99, 0x11d2, 0xaa, 0x15, 0x0, 0x80, 0xc7, 0xc5, 0x75, 0xc0);
  143.  
  144. //  Command ID to return the real IUnknown of the hosted applet.  Most clients
  145. //  can access all of the COM functionality through the applet control itself,
  146. //  such as IDispatch or IConnectionPointContainer.
  147. #define APPLETCMDID_GETAPPLETUNKNOWN    0
  148.  
  149. //
  150. //  IID_ICreatesJavaObjects
  151. //
  152. //  A "flag" interface for COM objects in the VM that create Java objects.
  153. //  Examples include the class factories and java: monikers.  The "interface"
  154. //  contains no methods beyond the standard IUnknown.
  155. //
  156.  
  157. // {92F362C0-CF5A-11d1-A93C-0080C7C575C0}
  158. DEFINE_GUID(IID_ICreatesJavaObjects,
  159. 0x92f362c0, 0xcf5a, 0x11d1, 0xa9, 0x3c, 0x0, 0x80, 0xc7, 0xc5, 0x75, 0xc0);
  160.  
  161. //
  162. // Custom data GUIDs for use in IDL files and type libraries.
  163. //
  164. // MIDL does not currently compile size_is and iid_is attribute information
  165. //  into the type library generated for an IDL file.  The GUIDs (and
  166. //  associated macros) below can be used to transfer size_is and iid_is
  167. //  information from an IDL file to a type library, in the form of custom data.
  168. //  JActiveX will look for these custom data GUIDs in type libraries given as
  169. //  input and transfer the size_is and iid_is information to the generated
  170. //  wrapper classes.
  171. //
  172. // See the macros (e.g., JTLBATTR_SIZE_IS) below for example IDL usage.
  173. //
  174.  
  175. // {31A2F530-484B-11d2-9670-0080C7E171C0}
  176. DEFINE_GUID(GUID_JavaSizeIs,
  177. 0x31A2F530, 0x484B, 0x11d2, 0x96, 0x70, 0x0, 0x80, 0xc7, 0xe1, 0x71, 0xc0);
  178.  
  179.  
  180. // {31A2F531-484B-11d2-9670-0080C7E171C0}
  181. DEFINE_GUID(GUID_JavaIIDIs,
  182. 0x31A2F531, 0x484B, 0x11d2, 0x96, 0x70, 0x0, 0x80, 0xc7, 0xe1, 0x71, 0xc0);
  183.  
  184.  
  185. #else   // !ifndef __midl
  186.  
  187.  
  188. //==============================================================================
  189. // Custom data attribute "GUIDS"- for use in IDL files.
  190. //==============================================================================
  191. #define JTLBATTR_GUID_SIZE_IS   31A2F530-484B-11d2-9670-0080C7E171C0
  192. #define JTLBATTR_GUID_IID_IS    31A2F531-484B-11d2-9670-0080C7E171C0
  193.  
  194. //==============================================================================
  195. // **** NEW FOR Windows 2000 and SDK 4.0 VM ****
  196. // Custom data attribute macros- for use in IDL files.
  197. //
  198. // These macros should be used in parameter attribute lists in IDL files
  199. //  to have size_is and iid_is information propagated to type libraries
  200. //  generated by MIDL.  The tool JActiveX, found in the Microsoft SDK for
  201. //  Java, can then be used to generate java classes that carry the
  202. //  size_is/iid_is information.
  203. // paramData in the macros below may be a string (parameter name) or integer
  204. //  (parameter index) and specifies the attribute parameter that will give the
  205. //  size or iid for the target parameter.  If the attribute parameter is passed
  206. //  by-reference (pointer), the VM will automatically dereference it to
  207. //  obtain a usable value.
  208. // JTLBATTR_SIZE_IS (analog of IDL size_is) can be specified only for parameters
  209. //  that will be arrays in java (generally, pointers).
  210. // JTLBATTR_IID_IS (analog of IDL iid_is) can be specifed only on for interface
  211. //  pointers and retval, byref interface pointers.
  212. //
  213. // Example psuedo-IDL:
  214. //
  215. //  interface IAttributed : IUnknown
  216. //  {
  217. //      HRESULT _stdcall CreateInstance(
  218. //          [in] REFIID riid,
  219. //          [out, retval, iid_is( riid ), JTLBATTR_IID_IS( "riid" )] IUnknown **ppunk );
  220. //
  221. //        HRESULT _stdcall In(
  222. //          [in] REFIID riid,
  223. //          [in, iid_is( riid ), JTLBATTR_IID_IS( "riid" )] IUnknown *punk );
  224. //
  225. //      HRESULT _stdcall Next(
  226. //          [in] ULONG celt,
  227. //          [out, size_is( celt ), JTLBATTR_SIZE_IS( "celt" )] int *rgelt,
  228. //          [out] ULONG *pceltFetched );
  229. //  }
  230. //
  231. //==============================================================================
  232. #define JTLBATTR_SIZE_IS( paramData )   custom( JTLBATTR_GUID_SIZE_IS, paramData )
  233. #define JTLBATTR_IID_IS( paramData )    custom( JTLBATTR_GUID_IID_IS, paramData )
  234.  
  235.  
  236. #endif
  237.  
  238.  
  239. #endif
  240.