home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / Software / TemaCD / devc / _SETUP.5 / Group3 / oleauto.h < prev    next >
C/C++ Source or Header  |  1999-11-07  |  10KB  |  238 lines

  1. #ifndef _OLEAUTO_H
  2. #define _OLEAUTO_H
  3. #pragma pack(push,8)
  4. #define WINOLEAUTAPI STDAPI
  5. #define WINOLEAUTAPI_(type) STDAPI_(type)
  6. #define STDOLE_MAJORVERNUM 1
  7. #define STDOLE_MINORVERNUM 0
  8. #define STDOLE_LCID 0
  9. #define VARIANT_NOVALUEPROP 1
  10. #define VAR_TIMEVALUEONLY 0x0001
  11. #define VAR_DATEVALUEONLY 0x0002
  12. #define MEMBERID_NIL DISPID_UNKNOWN
  13. #define ID_DEFAULTINST (-2)
  14. #define DISPATCH_METHOD 1
  15. #define DISPATCH_PROPERTYGET 2
  16. #define DISPATCH_PROPERTYPUT 4
  17. #define DISPATCH_PROPERTYPUTREF 8
  18. #define LHashValOfName(l,n) LHashValOfNameSys(SYS_WIN32,l,n)
  19. #define WHashValOfLHashVal(h) ((unsigned short)(0x0000ffff&(h)))
  20. #define IsHashValCompatible(h1,h2) ((BOOL)((0x00ff0000&(h1))==(0x00ff0000&(h2))))
  21. #define ACTIVEOBJECT_STRONG 0
  22. #define ACTIVEOBJECT_WEAK 1
  23. #ifdef NONAMELESSUNION
  24. #define V_UNION(X,Y) ((X)->u.Y)
  25. #else
  26. #define V_UNION(X,Y) ((X)->Y)
  27. #endif
  28. #ifdef __cplusplus
  29. #define V_BOOL(X) V_UNION(X,boolVal)
  30. #else
  31. #define V_BOOL(X) V_UNION(X,bool)
  32. #endif
  33. #define V_VT(X) ((X)->vt)
  34. #define V_ISBYREF(X) (V_VT(X)&VT_BYREF)
  35. #define V_ISARRAY(X) (V_VT(X)&VT_ARRAY)
  36. #define V_ISVECTOR(X) (V_VT(X)&VT_VECTOR)
  37. #define V_NONE(X) V_I2(X)
  38. #define V_UI1(X) V_UNION(X,bVal)
  39. #define V_UI1REF(X) V_UNION(X,pbVal)
  40. #define V_I2(X) V_UNION(X,iVal)
  41. #define V_I2REF(X) V_UNION(X,piVal)
  42. #define V_I4(X) V_UNION(X,lVal)
  43. #define V_I4REF(X) V_UNION(X,plVal)
  44. #define V_I8(X) V_UNION(X,hVal)
  45. #define V_I8REF(X) V_UNION(X,phVal)
  46. #define V_R4(X) V_UNION(X,fltVal)
  47. #define V_R4REF(X) V_UNION(X,pfltVal)
  48. #define V_R8(X) V_UNION(X,dblVal)
  49. #define V_R8REF(X) V_UNION(X,pdblVal)
  50. #define V_CY(X) V_UNION(X,cyVal)
  51. #define V_CYREF(X) V_UNION(X,pcyVal)
  52. #define V_DATE(X) V_UNION(X,date)
  53. #define V_DATEREF(X) V_UNION(X,pdate)
  54. #define V_BSTR(X) V_UNION(X,bstrVal)
  55. #define V_BSTRREF(X) V_UNION(X,pbstrVal)
  56. #define V_DISPATCH(X) V_UNION(X,pdispVal)
  57. #define V_DISPATCHREF(X) V_UNION(X,ppdispVal)
  58. #define V_ERROR(X) V_UNION(X,scode)
  59. #define V_ERRORREF(X) V_UNION(X,pscode)
  60. #define V_BOOLREF(X) V_UNION(X,pbool)
  61. #define V_UNKNOWN(X) V_UNION(X,punkVal)
  62. #define V_UNKNOWNREF(X) V_UNION(X,ppunkVal)
  63. #define V_VARIANTREF(X) V_UNION(X,pvarVal)
  64. #define V_LPSTR(X) V_UNION(X,pszVal)
  65. #define V_LPSTRREF(X) V_UNION(X,ppszVal)
  66. #define V_LPWSTR(X) V_UNION(X,pwszVal)
  67. #define V_LPWSTRREF(X) V_UNION(X,ppwszVal)
  68. #define V_FILETIME(X) V_UNION(X,filetime)
  69. #define V_FILETIMEREF(X) V_UNION(X,pfiletime)
  70. #define V_BLOB(X) V_UNION(X,blob)
  71. #define V_UUID(X) V_UNION(X,puuid)
  72. #define V_CLSID(X) V_UNION(X,puuid)
  73. #define V_ARRAY(X) V_UNION(X,parray)
  74. #define V_ARRAYREF(X) V_UNION(X,pparray)
  75. #define V_BYREF(X) V_UNION(X,byref)
  76.  
  77. #include <oaidl.h>
  78.  
  79. typedef struct tagPARAMDATA {
  80.     OLECHAR *szName;
  81.     VARTYPE vt;
  82. } PARAMDATA,*LPPARAMDATA;
  83. typedef struct tagMETHODDATA {
  84.     OLECHAR *szName;
  85.     PARAMDATA *ppdata;
  86.     DISPID dispid;
  87.     UINT iMeth;
  88.     CALLCONV cc;
  89.     UINT cArgs;
  90.     WORD wFlags;
  91.     VARTYPE vtReturn;
  92. } METHODDATA,*LPMETHODDATA;
  93. typedef struct tagINTERFACEDATA {
  94.     METHODDATA *pmethdata;
  95.     UINT cMembers;
  96. } INTERFACEDATA,*LPINTERFACEDATA;
  97.  
  98. WINOLEAUTAPI_(BSTR) SysAllocString(const OLECHAR*);
  99. WINOLEAUTAPI_(int) SysReAllocString(BSTR*,const OLECHAR*);
  100. WINOLEAUTAPI_(BSTR) SysAllocStringLen(const OLECHAR*,unsigned int);
  101. WINOLEAUTAPI_(int) SysReAllocStringLen(BSTR*,const OLECHAR*,unsigned int);
  102. WINOLEAUTAPI_(void) SysFreeString(BSTR);
  103. WINOLEAUTAPI_(unsigned int) SysStringLen(BSTR);
  104. WINOLEAUTAPI_(unsigned int) SysStringByteLen(BSTR);
  105. WINOLEAUTAPI_(BSTR) SysAllocStringByteLen(const char*,unsigned int);
  106. WINOLEAUTAPI_(int) DosDateTimeToVariantTime(unsigned short,unsigned short,double*);
  107. WINOLEAUTAPI_(int) VariantTimeToDosDateTime(double,unsigned short*,unsigned short*);
  108. WINOLEAUTAPI SafeArrayAllocDescriptor(unsigned int,SAFEARRAY**);
  109. WINOLEAUTAPI SafeArrayAllocData(SAFEARRAY*);
  110. WINOLEAUTAPI_(SAFEARRAY*) SafeArrayCreate(VARTYPE,unsigned int,SAFEARRAYBOUND*);
  111. WINOLEAUTAPI SafeArrayDestroyDescriptor(SAFEARRAY*);
  112. WINOLEAUTAPI SafeArrayDestroyData(SAFEARRAY*);
  113. WINOLEAUTAPI SafeArrayDestroy(SAFEARRAY*);
  114. WINOLEAUTAPI SafeArrayRedim(SAFEARRAY*,SAFEARRAYBOUND*);
  115. WINOLEAUTAPI_(unsigned int) SafeArrayGetDim(SAFEARRAY*);
  116. WINOLEAUTAPI_(unsigned int) SafeArrayGetElemsize(SAFEARRAY*);
  117. WINOLEAUTAPI SafeArrayGetUBound(SAFEARRAY*,unsigned int,long*);
  118. WINOLEAUTAPI SafeArrayGetLBound(SAFEARRAY*,unsigned int,long*);
  119. WINOLEAUTAPI SafeArrayLock(SAFEARRAY*);
  120. WINOLEAUTAPI SafeArrayUnlock(SAFEARRAY*);
  121. WINOLEAUTAPI SafeArrayAccessData(SAFEARRAY*,void**);
  122. WINOLEAUTAPI SafeArrayUnaccessData(SAFEARRAY*);
  123. WINOLEAUTAPI SafeArrayGetElement(SAFEARRAY*,long*,void*);
  124. WINOLEAUTAPI SafeArrayPutElement(SAFEARRAY*,long*,void*);
  125. WINOLEAUTAPI SafeArrayCopy(SAFEARRAY*,SAFEARRAY**);
  126. WINOLEAUTAPI SafeArrayPtrOfIndex(SAFEARRAY*,long*,void**);
  127. WINOLEAUTAPI_(void) VariantInit(VARIANTARG*);
  128. WINOLEAUTAPI VariantClear(VARIANTARG*);
  129. WINOLEAUTAPI VariantCopy(VARIANTARG*,VARIANTARG*);
  130. WINOLEAUTAPI VariantCopyInd(VARIANT*,VARIANTARG*);
  131. WINOLEAUTAPI VariantChangeType(VARIANTARG*,VARIANTARG*,unsigned short,VARTYPE);
  132. WINOLEAUTAPI VariantChangeTypeEx(VARIANTARG*,VARIANTARG*,LCID,unsigned short,VARTYPE);
  133. WINOLEAUTAPI VarUI1FromI2(short,unsigned char*);
  134. WINOLEAUTAPI VarUI1FromI4(long,unsigned char*);
  135. WINOLEAUTAPI VarUI1FromR4(float,unsigned char*);
  136. WINOLEAUTAPI VarUI1FromR8(double,unsigned char*);
  137. WINOLEAUTAPI VarUI1FromCy(CY,unsigned char*);
  138. WINOLEAUTAPI VarUI1FromDate(DATE,unsigned char*);
  139. WINOLEAUTAPI VarUI1FromStr(OLECHAR*,LCID,unsigned long,unsigned char*);
  140. WINOLEAUTAPI VarUI1FromDisp(LPDISPATCH*,LCID,unsigned char*);
  141. WINOLEAUTAPI VarUI1FromBool(VARIANT_BOOL,unsigned char*);
  142. WINOLEAUTAPI VarI2FromUI1(unsigned char,short*);
  143. WINOLEAUTAPI VarI2FromI4(long,short*);
  144. WINOLEAUTAPI VarI2FromR4(float,short*);
  145. WINOLEAUTAPI VarI2FromR8(double,short*);
  146. WINOLEAUTAPI VarI2FromCy(CY cyIn,short*);
  147. WINOLEAUTAPI VarI2FromDate(DATE,short*);
  148. WINOLEAUTAPI VarI2FromStr(OLECHAR*,LCID,unsigned long,short*);
  149. WINOLEAUTAPI VarI2FromDisp(LPDISPATCH*,LCID,short*);
  150. WINOLEAUTAPI VarI2FromBool(VARIANT_BOOL,short*);
  151. WINOLEAUTAPI VarI4FromUI1(unsigned char,long*);
  152. WINOLEAUTAPI VarI4FromI2(short,long*);
  153. WINOLEAUTAPI VarI4FromR4(float,long*);
  154. WINOLEAUTAPI VarI4FromR8(double,long*);
  155. WINOLEAUTAPI VarI4FromCy(CY,long*);
  156. WINOLEAUTAPI VarI4FromDate(DATE,long*);
  157. WINOLEAUTAPI VarI4FromStr(OLECHAR*,LCID,unsigned long,long*);
  158. WINOLEAUTAPI VarI4FromDisp(LPDISPATCH*,LCID,long*);
  159. WINOLEAUTAPI VarI4FromBool(VARIANT_BOOL,long*);
  160. WINOLEAUTAPI VarR4FromUI1(unsigned char,float*);
  161. WINOLEAUTAPI VarR4FromI2(short,float*);
  162. WINOLEAUTAPI VarR4FromI4(long,float*);
  163. WINOLEAUTAPI VarR4FromR8(double,float*);
  164. WINOLEAUTAPI VarR4FromCy(CY,float*);
  165. WINOLEAUTAPI VarR4FromDate(DATE,float*);
  166. WINOLEAUTAPI VarR4FromStr(OLECHAR*,LCID,unsigned long,float*);
  167. WINOLEAUTAPI VarR4FromDisp(LPDISPATCH*,LCID,float*);
  168. WINOLEAUTAPI VarR4FromBool(VARIANT_BOOL,float*);
  169. WINOLEAUTAPI VarR8FromUI1(unsigned char,double*);
  170. WINOLEAUTAPI VarR8FromI2(short,double*);
  171. WINOLEAUTAPI VarR8FromI4(long,double*);
  172. WINOLEAUTAPI VarR8FromR4(float,double*);
  173. WINOLEAUTAPI VarR8FromCy(CY,double*);
  174. WINOLEAUTAPI VarR8FromDate(DATE,double*);
  175. WINOLEAUTAPI VarR8FromStr(OLECHAR*,LCID,unsigned long,double*);
  176. WINOLEAUTAPI VarR8FromDisp(LPDISPATCH*,LCID,double*);
  177. WINOLEAUTAPI VarR8FromBool(VARIANT_BOOL,double*);
  178. WINOLEAUTAPI VarDateFromUI1(unsigned char,DATE*);
  179. WINOLEAUTAPI VarDateFromI2(short,DATE*);
  180. WINOLEAUTAPI VarDateFromI4(long,DATE*);
  181. WINOLEAUTAPI VarDateFromR4(float,DATE*);
  182. WINOLEAUTAPI VarDateFromR8(double,DATE*);
  183. WINOLEAUTAPI VarDateFromCy(CY,DATE*);
  184. WINOLEAUTAPI VarDateFromStr(OLECHAR*,LCID,unsigned long,DATE*);
  185. WINOLEAUTAPI VarDateFromDisp(LPDISPATCH*,LCID,DATE*);
  186. WINOLEAUTAPI VarDateFromBool(VARIANT_BOOL,DATE*);
  187. WINOLEAUTAPI VarCyFromUI1(unsigned char,CY*);
  188. WINOLEAUTAPI VarCyFromI2(short,CY*);
  189. WINOLEAUTAPI VarCyFromI4(long,CY*);
  190. WINOLEAUTAPI VarCyFromR4(float,CY*);
  191. WINOLEAUTAPI VarCyFromR8(double,CY*);
  192. WINOLEAUTAPI VarCyFromDate(DATE,CY*);
  193. WINOLEAUTAPI VarCyFromStr(OLECHAR*,LCID,unsigned long,CY*);
  194. WINOLEAUTAPI VarCyFromDisp(LPDISPATCH*,LCID,CY*);
  195. WINOLEAUTAPI VarCyFromBool(VARIANT_BOOL,CY*);
  196. WINOLEAUTAPI VarBstrFromUI1(unsigned char,LCID,unsigned long,BSTR*);
  197. WINOLEAUTAPI VarBstrFromI2(short,LCID,unsigned long,BSTR*);
  198. WINOLEAUTAPI VarBstrFromI4(long,LCID,unsigned long,BSTR*);
  199. WINOLEAUTAPI VarBstrFromR4(float,LCID,unsigned long,BSTR*);
  200. WINOLEAUTAPI VarBstrFromR8(double,LCID,unsigned long,BSTR*);
  201. WINOLEAUTAPI VarBstrFromCy(CY,LCID,unsigned long,BSTR*);
  202. WINOLEAUTAPI VarBstrFromDate(DATE,LCID,unsigned long,BSTR*);
  203. WINOLEAUTAPI VarBstrFromDisp(LPDISPATCH*,LCID,unsigned long,BSTR*);
  204. WINOLEAUTAPI VarBstrFromBool(VARIANT_BOOL,LCID,unsigned long,BSTR*);
  205. WINOLEAUTAPI VarBoolFromUI1(unsigned char,VARIANT_BOOL*);
  206. WINOLEAUTAPI VarBoolFromI2(short,VARIANT_BOOL*);
  207. WINOLEAUTAPI VarBoolFromI4(long,VARIANT_BOOL*);
  208. WINOLEAUTAPI VarBoolFromR4(float,VARIANT_BOOL*);
  209. WINOLEAUTAPI VarBoolFromR8(double,VARIANT_BOOL*);
  210. WINOLEAUTAPI VarBoolFromDate(DATE,VARIANT_BOOL*);
  211. WINOLEAUTAPI VarBoolFromCy(CY,VARIANT_BOOL*);
  212. WINOLEAUTAPI VarBoolFromStr(OLECHAR*,LCID,unsigned long,VARIANT_BOOL*);
  213. WINOLEAUTAPI VarBoolFromDisp(LPDISPATCH*,LCID,VARIANT_BOOL*);
  214. WINOLEAUTAPI_(ULONG) LHashValOfNameSysA(SYSKIND,LCID,const char*);
  215. WINOLEAUTAPI_(ULONG) LHashValOfNameSys(SYSKIND,LCID,const OLECHAR*);
  216. WINOLEAUTAPI LoadTypeLib(const OLECHAR*,LPTYPELIB*);
  217. WINOLEAUTAPI LoadRegTypeLib(REFGUID,WORD,WORD,LCID,LPTYPELIB*);
  218. WINOLEAUTAPI QueryPathOfRegTypeLib(REFGUID,unsigned short,unsigned short,LCID,LPBSTR);
  219. WINOLEAUTAPI RegisterTypeLib(LPTYPELIB,OLECHAR*,OLECHAR*);
  220. WINOLEAUTAPI DeregisterTypeLib(REFGUID,WORD,WORD,LCID);
  221. WINOLEAUTAPI CreateTypeLib(SYSKIND,const OLECHAR*,LPCREATETYPELIB*);
  222. WINOLEAUTAPI DispGetParam(DISPPARAMS*,UINT,VARTYPE,VARIANT*,UINT*);
  223. WINOLEAUTAPI DispGetIDsOfNames(LPTYPEINFO,OLECHAR**,UINT,DISPID*);
  224. WINOLEAUTAPI DispInvoke(void*,LPTYPEINFO,DISPID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,UINT*);
  225. WINOLEAUTAPI CreateDispTypeInfo(INTERFACEDATA*,LCID,LPTYPEINFO*);
  226. WINOLEAUTAPI CreateStdDispatch(IUnknown*,void*,LPTYPEINFO,IUnknown**);
  227. WINOLEAUTAPI RegisterActiveObject(IUnknown*,REFCLSID,DWORD,DWORD*);
  228. WINOLEAUTAPI RevokeActiveObject(DWORD,void*);
  229. WINOLEAUTAPI GetActiveObject(REFCLSID,void*,IUnknown**);
  230. WINOLEAUTAPI SetErrorInfo(unsigned long,LPERRORINFO);
  231. WINOLEAUTAPI GetErrorInfo(unsigned long,LPERRORINFO*);
  232. WINOLEAUTAPI CreateErrorInfo(LPCREATEERRORINFO*);
  233. WINOLEAUTAPI_(unsigned long) OaBuildVersion(void);
  234. WINOLEAUTAPI VectorFromBstr (BSTR, SAFEARRAY **);
  235. WINOLEAUTAPI BstrFromVector (SAFEARRAY *, BSTR *);
  236. #pragma pack(pop)
  237. #endif
  238.