home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Microsoft Plateform / Visual Basic 5.0 / Msvb50.ace / msvb50 / MSVB50 / VB / REPOSTRY / INCLUDE / REPENG.BAS < prev    next >
Encoding:
BASIC Source File  |  1997-01-03  |  10.1 KB  |  252 lines

  1. Attribute VB_Name = "ReposInit"
  2. ' ------------------------------------------------------------------------
  3. '               Copyright (C) 1996 Microsoft Corporation
  4. '
  5. ' You have a royalty-free right to use, modify, reproduce and distribute
  6. ' the Sample Application Files (and/or any modified version) in any way
  7. ' you find useful, provided that you agree that Microsoft has no warranty,
  8. ' obligations or liability for any Sample Application Files.
  9. ' ------------------------------------------------------------------------
  10. '$include 'odbcor_g.bi'
  11. '$include 'odbext_g.bi'
  12.  
  13. ' ------------------------------------------------------------------------
  14. ' This file contains a bunch of variant declarations for variables that
  15. ' represent object identifiers for repository Type Information Model objects.
  16. '   (For more information about Type Information Model objects, see the
  17. '    Repository Programmer's Guide in Visual Basic Books Online.)
  18. ' A pile of error number constants for repository specific errors are also defined.
  19. '
  20. ' Two subroutines (DEFINE_OBJID and InitRepository) and one function (InitGuid)
  21. ' are also contained in this file.
  22. ' ------------------------------------------------------------------------
  23. Public CLSID_RepositoryObject As Variant
  24.  
  25. ' Repository Type Infomation Model Object IDs.
  26. Public OBJID_ClassDef As Variant
  27. Public OBJID_InterfaceDef As Variant
  28. Public OBJID_CollectionDef As Variant
  29. Public OBJID_MethodDef As Variant
  30. Public OBJID_PropertyDef As Variant
  31. Public OBJID_RelationshipDef As Variant
  32. Public OBJID_ReposTypeLib As Variant
  33. Public OBJID_ReposRoot As Variant
  34.  
  35. Public OBJID_IUnknown As Variant
  36. Public OBJID_IDispatch As Variant
  37. Public OBJID_IReposDispatch As Variant
  38. Public OBJID_IReposTypeInfo As Variant
  39. Public OBJID_IClassDef As Variant
  40. Public OBJID_IInterfaceDef As Variant
  41. Public OBJID_IInterfaceMember As Variant
  42. Public OBJID_IPropertyDef As Variant
  43. Public OBJID_ICollectionDef As Variant
  44. Public OBJID_IRepositoryItem As Variant
  45. Public OBJID_IRepositoryObject As Variant
  46. Public OBJID_IRelationship As Variant
  47. Public OBJID_IAnnotationalProps As Variant
  48. Public OBJID_ISummaryInfo As Variant
  49. Public OBJID_INamedObject As Variant
  50. Public OBJID_IManageReposTypeLib As Variant
  51. Public OBJID_IReposTypeLib As Variant
  52. Public OBJID_IReposRoot As Variant
  53.  
  54. Public OBJID_RClassImplIface As Variant
  55. Public OBJID_RIfaceInheritsFromIface As Variant
  56. Public OBJID_RIfaceHasMembers As Variant
  57. Public OBJID_RColContainsItems As Variant
  58. Public OBJID_RContainerContextForReposTLBs As Variant
  59. Public OBJID_RReposTLBScopeForReposTypeInfo As Variant
  60.  
  61. Public OBJID_Ifaces As Variant
  62. Public OBJID_Classes As Variant
  63. Public OBJID_Ancestor As Variant
  64. Public OBJID_Descendants As Variant
  65. Public OBJID_Members As Variant
  66. Public OBJID_Iface As Variant
  67. Public OBJID_CollectionItem As Variant
  68. Public OBJID_Collection As Variant
  69. Public OBJID_ReposTypeLibs As Variant
  70. Public OBJID_ReposTLBContexts As Variant
  71. Public OBJID_ReposTypeInfos As Variant
  72. Public OBJID_ReposTypeLibScopes As Variant
  73.  
  74. Public OBJID_ReposRootObj As Variant
  75. Public OBJID_ReposTIM As Variant
  76.  
  77. Public OBJID_NULL As Variant
  78.  
  79. Public Const EREP_BADPARAMS = &H80041000
  80. Public Const EREP_BADNAME = &H80041001
  81. Public Const EREP_BADDRIVER = &H80041002
  82. Public Const EREP_BADERROR = &H80041003
  83. Public Const EREP_BUFFER_OVERFLOW = &H80041004
  84. Public Const EREP_NOROWSFOUND = &H80041011
  85. Public Const EREP_ODBC_CERROR = &H80041012
  86. Public Const EREP_ODBC_MDBNOTFOUND = &H80041013
  87. Public Const EREP_NEED_DATA = &H80041014
  88. Public Const EREP_ODBC_UNKNOWNDRIVER = &H80041015
  89. Public Const EREP_ODBC_CREATEFAILED = &H80041016
  90. Public Const EREP_ODBC_WARNINGS = &H1017
  91. Public Const EREP_DB_EXISTS = &H80041030
  92. Public Const EREP_DB_NOTCONNECTED = &H80041031
  93. Public Const EREP_DB_ALREADYCONNECTED = &H80041032
  94. Public Const EREP_DB_DBMSONETHREAD = &H80041033
  95. Public Const EREP_DB_CORRUPT = &H80041034
  96. Public Const EREP_DB_NOSCHEMA = &H80041035
  97. Public Const EREP_DB_DBMSOLD = &H80041036
  98. Public Const EREP_DB_READONLY = &H80041037
  99. Public Const EREP_TXN_NOTXNACTIVE = &H80041041
  100. Public Const EREP_TXN_AUTOABORT = &H80041042
  101. Public Const EREP_TXN_TOOMANY = &H80041043
  102. Public Const EREP_TXN_TIMEOUT = &H80041044
  103. Public Const EREP_TXN_NODATA = &H80041045
  104. Public Const EREP_TXN_NOSETINTXN = &H80041046
  105. Public Const EREP_TXN_OBJABORTED = &H80041047
  106. Public Const EREP_TXN_COLABORTED = &H80041048
  107. Public Const EREP_REPOS_CACHEFULL = &H80041070
  108. Public Const EREP_REPOS_NONEXTDISPID = &H80041071
  109. Public Const EREP_RELSHIP_EXISTS = &H80041100
  110. Public Const EREP_RELSHIP_INVALID_PAIR = &H80041101
  111. Public Const EREP_RELSHIP_NOTFOUND = &H80041102
  112. Public Const EREP_RELSHIP_ORGONLY = &H80041105
  113. Public Const EREP_RELSHIP_OUTOFDATE = &H80041106
  114. Public Const EREP_RELSHIP_INVALIDFLAGS = &H80041107
  115. Public Const EREP_RELSHIP_NAMEINVALID = &H80041108
  116. Public Const EREP_RELSHIP_DUPENAME = &H80041109
  117. Public Const EREP_TYPE_TABLEMISMATCH = &H80041120
  118. Public Const EREP_TYPE_COLMISMATCH = &H80041121
  119. Public Const EREP_TYPE_NOTNULLABLE = &H80041122
  120. Public Const EREP_TYPE_MULTIDEFIFACES = &H80041123
  121. Public Const EREP_TYPE_INVERTEDNOTALLOWED = &H80041124
  122. Public Const EREP_TYPE_INVALIDSCALE = &H80041125
  123. Public Const EREP_LOCK_TIMEOUT = &H80041200
  124. Public Const EREP_QRY_BADCOLUMNS = &H80041250
  125. Public Const EREP_OBJ_NOTINITIALIZED = &H80041300
  126. Public Const EREP_OBJ_NOTFOUND = &H80041301
  127. Public Const EREP_OBJ_NONAMINGRELSHIP = &H80041302
  128. Public Const EREP_OBJ_EXISTS = &H80041303
  129. Public Const EREP_PROP_MISMATCH = &H80041400
  130. Public Const EREP_PROP_SETINVALID = &H80041401
  131. Public Const SREP_PROP_TRUNCATION = &H1402
  132. Public Const EREP_PROP_CANTSETREPTIM = &H80041403
  133. Public Const EREP_PROP_READONLY = &H80041404
  134. Public Const EREP_PROP_NOTEXISTS = &H80041405
  135. Public Const EREP_TIM_INVALIDFLAGS = &H80041500
  136. Public Const EREP_TIM_FLAGSDEST = &H80041501
  137. Public Const EREP_TIM_RELTYPEINVALID = &H80041502
  138. Public Const EREP_TIM_CTYPEINVALID = &H80041503
  139. Public Const EREP_TIM_TOOMANYCOLS = &H80041504
  140. Public Const EREP_TIM_SQLTYPEINVALID = &H80041505
  141.  
  142. ' ------------------------------------------------------------------------
  143. ' This function just stuffs the 16 byte values that you pass in into a
  144. ' contiguous GUID variant.
  145. ' ------------------------------------------------------------------------
  146. Function InitGuid(a As Byte, b As Byte, c As Byte, d As Byte, _
  147. e As Byte, f As Byte, g As Byte, h As Byte, _
  148. i As Byte, j As Byte, k As Byte, l As Byte, _
  149. m As Byte, n As Byte, o As Byte, p As Byte) As Variant
  150.  
  151. Dim Guid(0 To 15) As Byte
  152.  
  153. Guid(0) = a
  154. Guid(1) = b
  155. Guid(2) = c
  156. Guid(3) = d
  157. Guid(4) = e
  158. Guid(5) = f
  159. Guid(6) = g
  160. Guid(7) = h
  161. Guid(8) = i
  162. Guid(9) = j
  163. Guid(10) = k
  164. Guid(11) = l
  165. Guid(12) = m
  166. Guid(13) = n
  167. Guid(14) = o
  168. Guid(15) = p
  169.  
  170. InitGuid = Guid
  171. End Function
  172.  
  173. ' ------------------------------------------------------------------------
  174. ' This subroutine sets up an object identifier with the unique value that
  175. ' you pass in placed in the correct part of the object identifier.
  176. ' ------------------------------------------------------------------------
  177. Sub DEFINE_OBJID(ByRef id As Variant, uniquifier As Long, base() As Long)
  178.     base(4) = uniquifier
  179.     id = base
  180. End Sub
  181.  
  182. ' ------------------------------------------------------------------------
  183. ' This subroutine initializes all of the object identifiers for Type Information
  184. ' Model definition objects to their correct values.
  185. ' ------------------------------------------------------------------------
  186. Sub InitRepository()
  187.  
  188. Dim ObjID(0 To 4) As Long
  189.  
  190. CLSID_RepositoryObject = InitGuid(&HFB, &H70, &H22, &H6E, &H99, &HF7, &HCF, &H11, &H92, &H27, 0, &HAA, 0, &HA1, &HEB, &H95)
  191.  
  192. ' Set up the guid portion of the object IDs.
  193. ObjID(0) = &H90591B0C
  194. ObjID(1) = &H11CF24F7
  195. ObjID(2) = &HAA000A92
  196. ObjID(3) = &H95EBA100
  197.  
  198. Call DEFINE_OBJID(OBJID_ClassDef, 0, ObjID)
  199. Call DEFINE_OBJID(OBJID_InterfaceDef, 1, ObjID)
  200. Call DEFINE_OBJID(OBJID_CollectionDef, 2, ObjID)
  201. Call DEFINE_OBJID(OBJID_MethodDef, 3, ObjID)
  202. Call DEFINE_OBJID(OBJID_PropertyDef, 4, ObjID)
  203. Call DEFINE_OBJID(OBJID_RelationshipDef, 5, ObjID)
  204. Call DEFINE_OBJID(OBJID_ReposTypeLib, 6, ObjID)
  205. Call DEFINE_OBJID(OBJID_ReposRoot, 7, ObjID)
  206.  
  207. Call DEFINE_OBJID(OBJID_IUnknown, 8, ObjID)
  208. Call DEFINE_OBJID(OBJID_IDispatch, 9, ObjID)
  209. Call DEFINE_OBJID(OBJID_IReposDispatch, 10, ObjID)
  210. Call DEFINE_OBJID(OBJID_IReposTypeInfo, 11, ObjID)
  211. Call DEFINE_OBJID(OBJID_IClassDef, 12, ObjID)
  212. Call DEFINE_OBJID(OBJID_IInterfaceDef, 13, ObjID)
  213. Call DEFINE_OBJID(OBJID_IInterfaceMember, 14, ObjID)
  214. Call DEFINE_OBJID(OBJID_IPropertyDef, 15, ObjID)
  215. Call DEFINE_OBJID(OBJID_ICollectionDef, 16, ObjID)
  216. Call DEFINE_OBJID(OBJID_IRepositoryItem, 17, ObjID)
  217. Call DEFINE_OBJID(OBJID_IRepositoryObject, 18, ObjID)
  218. Call DEFINE_OBJID(OBJID_IRelationship, 19, ObjID)
  219. Call DEFINE_OBJID(OBJID_IAnnotationalProps, 20, ObjID)
  220. Call DEFINE_OBJID(OBJID_ISummaryInfo, 21, ObjID)
  221. Call DEFINE_OBJID(OBJID_INamedObject, 22, ObjID)
  222. Call DEFINE_OBJID(OBJID_IManageReposTypeLib, 23, ObjID)
  223. Call DEFINE_OBJID(OBJID_IReposTypeLib, 24, ObjID)
  224. Call DEFINE_OBJID(OBJID_IReposRoot, 25, ObjID)
  225.  
  226. Call DEFINE_OBJID(OBJID_RClassImplIface, 26, ObjID)
  227. Call DEFINE_OBJID(OBJID_RIfaceInheritsFromIface, 27, ObjID)
  228. Call DEFINE_OBJID(OBJID_RIfaceHasMembers, 28, ObjID)
  229. Call DEFINE_OBJID(OBJID_RColContainsItems, 29, ObjID)
  230. Call DEFINE_OBJID(OBJID_RContainerContextForReposTLBs, 30, ObjID)
  231. Call DEFINE_OBJID(OBJID_RReposTLBScopeForReposTypeInfo, 31, ObjID)
  232.  
  233. Call DEFINE_OBJID(OBJID_Ifaces, 32, ObjID)
  234. Call DEFINE_OBJID(OBJID_Classes, 33, ObjID)
  235. Call DEFINE_OBJID(OBJID_Ancestor, 34, ObjID)
  236. Call DEFINE_OBJID(OBJID_Descendants, 35, ObjID)
  237. Call DEFINE_OBJID(OBJID_Members, 36, ObjID)
  238. Call DEFINE_OBJID(OBJID_Iface, 37, ObjID)
  239. Call DEFINE_OBJID(OBJID_CollectionItem, 38, ObjID)
  240. Call DEFINE_OBJID(OBJID_Collection, 39, ObjID)
  241. Call DEFINE_OBJID(OBJID_ReposTypeLibs, 40, ObjID)
  242. Call DEFINE_OBJID(OBJID_ReposTLBContexts, 41, ObjID)
  243. Call DEFINE_OBJID(OBJID_ReposTypeInfos, 42, ObjID)
  244. Call DEFINE_OBJID(OBJID_ReposTypeLibScopes, 43, ObjID)
  245.  
  246. Call DEFINE_OBJID(OBJID_ReposRootObj, 44, ObjID)
  247. Call DEFINE_OBJID(OBJID_ReposTIM, 45, ObjID)
  248.  
  249. Call DEFINE_OBJID(OBJID_NULL, &HFFFFFFFF, ObjID)
  250. End Sub
  251.  
  252.