home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / NIVB_SRC / NSINFO.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-06-03  |  6.2 KB  |  185 lines

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