home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / nsinfo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-07  |  6.3 KB  |  189 lines

  1. VERSION 2.00
  2. Begin Form NameSpaceInfoForm 
  3.    Caption         =   "Name Space Information"
  4.    ClientHeight    =   4980
  5.    ClientLeft      =   870
  6.    ClientTop       =   1530
  7.    ClientWidth     =   4680
  8.    Height          =   5385
  9.    Left            =   810
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   4980
  12.    ScaleWidth      =   4680
  13.    Top             =   1185
  14.    Width           =   4800
  15.    Begin ListBox DataStreamList 
  16.       Height          =   615
  17.       Left            =   1560
  18.       TabIndex        =   11
  19.       Top             =   2640
  20.       Width           =   3015
  21.    End
  22.    Begin ListBox NameSpaceList 
  23.       Height          =   1200
  24.       Left            =   1560
  25.       TabIndex        =   9
  26.       Top             =   1320
  27.       Width           =   3015
  28.    End
  29.    Begin CommandButton OKButton 
  30.       Caption         =   "&OK"
  31.       Height          =   372
  32.       Left            =   1800
  33.       TabIndex        =   0
  34.       Top             =   4560
  35.       Width           =   1092
  36.    End
  37.    Begin Label Label8 
  38.       Caption         =   "Name spaces marked by a tilde (~) are not supported by the operating system on the selected server."
  39.       Height          =   612
  40.       Left            =   360
  41.       TabIndex        =   14
  42.       Top             =   3840
  43.       Width           =   3972
  44.    End
  45.    Begin Label Label7 
  46.       Caption         =   "Name spaces or data streams marked by an asterisk (*) are not supported by the volume."
  47.       Height          =   372
  48.       Left            =   360
  49.       TabIndex        =   13
  50.       Top             =   3360
  51.       Width           =   3852
  52.    End
  53.    Begin Label Label6 
  54.       Alignment       =   1  'Right Justify
  55.       Caption         =   "Data streams supported:"
  56.       Height          =   372
  57.       Left            =   240
  58.       TabIndex        =   12
  59.       Top             =   2520
  60.       Width           =   1212
  61.    End
  62.    Begin Label Label5 
  63.       Alignment       =   1  'Right Justify
  64.       Caption         =   "Name spaces supported:"
  65.       Height          =   372
  66.       Left            =   120
  67.       TabIndex        =   10
  68.       Top             =   1200
  69.       Width           =   1332
  70.    End
  71.    Begin Label NumDataStreamLabel 
  72.       Height          =   252
  73.       Left            =   2400
  74.       TabIndex        =   8
  75.       Top             =   840
  76.       Width           =   2052
  77.    End
  78.    Begin Label NumNameSpaceLabel 
  79.       Height          =   252
  80.       Left            =   2400
  81.       TabIndex        =   7
  82.       Top             =   600
  83.       Width           =   2052
  84.    End
  85.    Begin Label VolumeLabel 
  86.       Height          =   252
  87.       Left            =   2400
  88.       TabIndex        =   6
  89.       Top             =   360
  90.       Width           =   2052
  91.    End
  92.    Begin Label ServerLabel 
  93.       Height          =   252
  94.       Left            =   2400
  95.       TabIndex        =   5
  96.       Top             =   120
  97.       Width           =   2172
  98.    End
  99.    Begin Label Label4 
  100.       Alignment       =   1  'Right Justify
  101.       Caption         =   "Number of Data Streams:"
  102.       Height          =   252
  103.       Left            =   120
  104.       TabIndex        =   4
  105.       Top             =   840
  106.       Width           =   2172
  107.    End
  108.    Begin Label Label3 
  109.       Alignment       =   1  'Right Justify
  110.       Caption         =   "Number of Name Spaces:"
  111.       Height          =   252
  112.       Left            =   120
  113.       TabIndex        =   3
  114.       Top             =   600
  115.       Width           =   2172
  116.    End
  117.    Begin Label Label2 
  118.       Alignment       =   1  'Right Justify
  119.       Caption         =   "Volume:"
  120.       Height          =   252
  121.       Left            =   720
  122.       TabIndex        =   2
  123.       Top             =   360
  124.       Width           =   1572
  125.    End
  126.    Begin Label Label1 
  127.       Alignment       =   1  'Right Justify
  128.       Caption         =   "Server:"
  129.       Height          =   252
  130.       Left            =   840
  131.       TabIndex        =   1
  132.       Top             =   120
  133.       Width           =   1452
  134.    End
  135. Sub Form_Unload (Cancel As Integer)
  136.     SetPreferredConnectionID (originalPrefConnID%)
  137. End Sub
  138. Sub OKButton_Click ()
  139.     Unload NameSpaceInfoForm
  140. End Sub
  141. Sub Form_Load ()
  142.     Dim buffer As NWBUFFER
  143.     Dim nameSpaceName As String * 16
  144.     Dim dataStreamName As String * 48
  145.     ccode% = GetConnectionID(serverName$, connID%)
  146.     If (ccode% <> SUCCESSFUL) Then
  147.         MsgBox "Unable to get connection ID of server " + serverName$, MB_OK, "Error"
  148.     Else
  149.         Unload NameSpaceForm
  150.         SetPreferredConnectionID (connID%)
  151.         ccode% = GetVolumeNumber(volumeName$, volume%)
  152.         ccode% = FillNameSpaceBuffer(connID%, volume%, buffer)
  153.         If (ccode% <> SUCCESSFUL) Then
  154.             MsgBox "Unable to get name space information", MB_OK, "Error"
  155.         Else
  156.             ccode% = GetNumNameSpaceAndDataStreams(buffer, numNameSpaces%, numDataStreams%)
  157.             ns = 0
  158.             nsFound = 1
  159.             Do
  160.                 ccode% = GetNameSpaceInfo(buffer, ns, nameSpaceName, osReady%, volSupports%)
  161.                 nsName = Left$(nameSpaceName, InStr(nameSpaceName, Chr$(0)) - 1)
  162.                 If (ccode% = SUCCESSFUL) Then
  163.                     nsFound = nsFound + 1
  164.                     If (volSupports% = 0) Then nsName = nsName + "*"
  165.                     If (osReady% = 0) Then nsName = nsName + "~"
  166.                     NameSpaceList.AddItem nsName
  167.                 End If
  168.                 ns = ns + 1
  169.             Loop While ((ns < 10) And (nsFound < numNameSpaces%))
  170.             ds = 0
  171.             dsFound = 1
  172.             Do
  173.                 ccode% = GetDataStreamInfo(buffer, ds, dataStreamName, volSupports%)
  174.                 dsName = Left$(dataStreamName, InStr(dataStreamName, Chr$(0)) - 1)
  175.                 If (ccode% = SUCCESSFUL) Then
  176.                     dsFound = dsFound + 1
  177.                     If (volSupports% = 0) Then dsName = dsName + "*"
  178.                     DataStreamList.AddItem dsName
  179.                 End If
  180.                 ds = ds + 1
  181.             Loop While ((ds < 10) And (dsFound < numDataStreams%))
  182.             ServerLabel = serverName$
  183.             VolumeLabel = volumeName$
  184.             NumNameSpaceLabel = Format$(numNameSpaces%)
  185.             NumDataStreamLabel = Format$(numDataStreams%)
  186.         End If
  187.     End If
  188. End Sub
  189.