home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sysmgmt / sms / vbsmsapi / common / vb4sms32.bas < prev   
Encoding:
BASIC Source File  |  1996-10-31  |  5.9 KB  |  144 lines

  1. Attribute VB_Name = "basVB4SMS32"
  2. Option Explicit
  3. '//****************************************************************************
  4. '//
  5. '//  Copyright (c) 1996, Microsoft Corporation
  6. '//
  7. '//  File:  VB4SMS32.BAS
  8. '//
  9. '//  History:
  10. '//
  11. '//      Gary Fuehrer, SEA   3/5/96      Created.
  12. '//
  13. '//****************************************************************************
  14. '
  15. 'The Declare statements that used to appear in this module are no longer
  16. 'necessary because they are now declared in the type library.  Use the
  17. 'Object Browser to view these declarations (see the View menu).  However,
  18. 'Because of some "features" of VB4, some of the declarations in the
  19. 'type library can not be used and must be overridden with a Declare statement.
  20. 'Only the functions for which this is the case appear here.
  21.  
  22. 'Because of yet another "feature" of VB4, some of the functions also needed a
  23. 'VB function wrapper.  These VB wrappers appear in this module as well.
  24. '
  25. '
  26.  
  27. '// ====================================================================
  28. '//      Version number API.
  29. '// ====================================================================
  30. '
  31. '  See also the Object Browser for declarations in the type library.
  32. '
  33. '
  34. '// ====================================================================
  35. '//      Engine APIs.
  36. '// ====================================================================
  37. '
  38.    Declare Function SmsDescribeFolderU& Lib "vb4sms32.olb" Alias "SmsDescribeFolderVB" (tObjectity As BASETYPE, ByVal dwTag As Long, pFolderInfo() As FOLDER_INFO)
  39. '
  40.    Declare Function SmsEnumContainers& Lib "vb4sms32.olb" Alias "SmsEnumContainersVB" (ContainerInfos() As FOLDER_INFO, pCount As Long)
  41. '
  42.    Declare Function SmsEnumFolders& Lib "vb4sms32.olb" Alias "SmsEnumFoldersVB" (FolderInfos() As FOLDER_INFO, pCount As Long)
  43. '
  44.    Declare Function SmsEnumFilters& Lib "vb4sms32.olb" Alias "SmsEnumFiltersVB" (FilterInfos() As FILTER_INFO, pCount As Long)
  45. '
  46. '  See also the Object Browser for declarations in the type library.
  47. '
  48. '
  49. '// ====================================================================
  50. '//      Connection APIs.
  51. '// ====================================================================
  52. '
  53.    Declare Function SmsDataSourceConnect& Lib "vb4sms32.olb" Alias "SmsDataSourceConnectVB" (pDataSource As SQL_CONNECT_PARAMS, phConn As Long)
  54. '
  55. '  See also the Object Browser for declarations in the type library.
  56. '
  57. '
  58. '// ====================================================================
  59. '//      Container APIS.
  60. '// ====================================================================
  61. '
  62.    Declare Function SmsPopulate& Lib "vb4sms32.olb" Alias "SmsPopulateVB" (ByVal hContainer As Long, ByVal dwOptions As Long, pNotify As Any)
  63. '
  64. '  See also the Object Browser for declarations in the type library.
  65. '
  66. '
  67. '// ====================================================================
  68. '//  Folder (collection) APIs.
  69. '//  A collection contains other things, that is it can have embedded
  70. '//  collections and it can also have properties (scalars).
  71. '// ====================================================================
  72. '
  73. '  See also the Object Browser for declarations in the type library.
  74. '
  75. '
  76. '// ====================================================================
  77. '//  Scalar APIs.
  78. '// ====================================================================
  79. '
  80.    Declare Function SmsGetNextScalarU& Lib "vb4sms32.olb" Alias "SmsGetNextScalarVB" (ByVal hFolder As Long, pScalar() As SCALAR)
  81. '
  82.    Declare Function SmsGetScalarByNameU& Lib "vb4sms32.olb" Alias "SmsGetScalarByNameVB" (ByVal hFolder As Long, ByVal pszName As String, pScalar() As SCALAR)
  83. '
  84.    Declare Function SmsSetScalarU& Lib "vb4sms32.olb" Alias "SmsSetScalarVB" (ByVal hFolder As Long, pScalar() As SCALAR)
  85. '
  86. '  See also the Object Browser for declarations in the type library.
  87. '
  88. '
  89. '// ====================================================================
  90. '//  FilterContainer APIs
  91. '// ====================================================================
  92. '
  93. '  See also the Object Browser for declarations in the type library.
  94. '
  95. '
  96. '// ====================================================================
  97. '//  Filter APIs
  98. '// ====================================================================
  99. '
  100.    Declare Function SmsGetToken& Lib "vb4sms32.olb" Alias "SmsGetTokenVB" (ByVal hObject As Long, ByVal iIndex As Long, pTokenInfo As TOKEN)
  101. '
  102.    Declare Function SmsAddToken& Lib "vb4sms32.olb" Alias "SmsAddTokenVB" (ByVal hObject As Long, opAndOr As ANDOR, pTokenInfo As TOKEN, ByVal iIndex As Long)
  103. '
  104.    Declare Function SmsEnumObjects& Lib "vb4sms32.olb" Alias "SmsEnumObjectsVB" (ByVal hConnection As Long, ByVal pszObjectType As String, pPredecessors() As String, ByVAl CtPredecessors As Long, pObjects() As OBJDESCRIPTOR, pCtObjects As Long)
  105. '
  106. '  See also the Object Browser for declarations in the type library.
  107.  
  108.  
  109. Function SmsDescribeFolder&(tObjectity As BASETYPE, ByVal dwTag As Long, pFolderInfo As FOLDER_INFO)
  110.     Dim FolderInfos(0) As FOLDER_INFO
  111.     Dim lRet&
  112.  
  113.     lRet& = SmsDescribeFolderU&(tObjectity, dwTag, FolderInfos)
  114.     If (lRet& = SMS_OK) Then pFolderInfo = FolderInfos(0)
  115.  
  116.     SmsDescribeFolder& = lRet&
  117. End Function
  118. Function SmsGetNextScalar&(ByVal hFolder As Long, pScalar As SCALAR)
  119.     Dim Scalars(0) As SCALAR
  120.     Dim lRet&
  121.  
  122.     lRet& = SmsGetNextScalarU&(hFolder, Scalars)
  123.     If (lRet& = SMS_OK) Then pScalar = Scalars(0)
  124.  
  125.     SmsGetNextScalar& = lRet&
  126. End Function
  127. Function SmsGetScalarByName&(ByVal hFolder As Long, ByVal pszName As String, pScalar As SCALAR)
  128.     Dim Scalars(0) As SCALAR
  129.     Dim lRet&
  130.  
  131.     lRet& = SmsGetScalarByNameU&(hFolder, pszName, Scalars)
  132.     If (lRet& = SMS_OK) Then pScalar = Scalars(0)
  133.  
  134.     SmsGetScalarByName& = lRet&
  135. End Function
  136.  
  137. Function SmsSetScalar&(ByVal hFolder As Long, pScalar As SCALAR)
  138.     Dim Scalars(0) As SCALAR
  139.  
  140.     Scalars(0) = pScalar
  141.     SmsSetScalar& = SmsSetScalarU&(hFolder, Scalars)
  142. End Function
  143.  
  144.