home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / nivb_src / diag.frm < prev    next >
Text File  |  1993-06-03  |  5KB  |  144 lines

  1. VERSION 2.00
  2. Begin Form DiagForm 
  3.    Caption         =   "Diagnostics Services Test"
  4.    Height          =   2190
  5.    Left            =   2100
  6.    LinkMode        =   1  'Source
  7.    LinkTopic       =   "Form1"
  8.    ScaleHeight     =   1785
  9.    ScaleWidth      =   4680
  10.    Top             =   1230
  11.    Width           =   4800
  12.    Begin CommandButton OKButton 
  13.       Caption         =   "&OK"
  14.       Height          =   372
  15.       Left            =   1920
  16.       TabIndex        =   0
  17.       Top             =   1320
  18.       Width           =   852
  19.    End
  20.    Begin Label shellVerLabel 
  21.       Height          =   255
  22.       Left            =   3600
  23.       TabIndex        =   3
  24.       Top             =   960
  25.       Width           =   855
  26.    End
  27.    Begin Label Label4 
  28.       Alignment       =   1  'Right Justify
  29.       Caption         =   "You are running NetWare shell version:"
  30.       Height          =   255
  31.       Left            =   120
  32.       TabIndex        =   7
  33.       Top             =   960
  34.       Width           =   3375
  35.    End
  36.    Begin Label SPXVerLabel 
  37.       Height          =   255
  38.       Left            =   3600
  39.       TabIndex        =   8
  40.       Top             =   720
  41.       Width           =   855
  42.    End
  43.    Begin Label Label3 
  44.       Alignment       =   1  'Right Justify
  45.       Caption         =   "You are running SPX version:"
  46.       Height          =   255
  47.       Left            =   840
  48.       TabIndex        =   6
  49.       Top             =   720
  50.       Width           =   2655
  51.    End
  52.    Begin Label IPXVerLabel 
  53.       Height          =   255
  54.       Left            =   3600
  55.       TabIndex        =   2
  56.       Top             =   480
  57.       Width           =   855
  58.    End
  59.    Begin Label Label2 
  60.       Alignment       =   1  'Right Justify
  61.       Caption         =   "You are running IPX version:"
  62.       Height          =   255
  63.       Left            =   840
  64.       TabIndex        =   5
  65.       Top             =   480
  66.       Width           =   2655
  67.    End
  68.    Begin Label connNumLabel 
  69.       Height          =   255
  70.       Left            =   3600
  71.       TabIndex        =   1
  72.       Top             =   240
  73.       Width           =   855
  74.    End
  75.    Begin Label Label1 
  76.       Alignment       =   1  'Right Justify
  77.       Caption         =   "You are at connection:"
  78.       Height          =   255
  79.       Left            =   1440
  80.       TabIndex        =   4
  81.       Top             =   240
  82.       Width           =   2055
  83.    End
  84. End
  85.  
  86. Sub Form_Load ()
  87.     Dim physNodeAddress As NodeAddress
  88.     Dim socketNum As Integer
  89.     Dim destination As BeginDiagnosticStruct
  90.     Dim compList As ComponentList
  91.     Dim response As AllResponseData
  92.     Dim ipxResponse As IPXSPXVersion
  93.     Dim shellResponse As ShellVersionStruct
  94.  
  95.     connNum& = GetConnectionNumber()
  96.     connNumLabel.Caption = Str$(connNum&)
  97.  
  98.     ccode% = GetInternetAddress(connNum&, networkNum&, physNodeAddress, socketNum)
  99.     If (ccode% <> SUCCESSFUL) Then
  100.         MsgBox "Unable to get your workstation's internetwork address", MB_OK, "Error"
  101.     Else
  102.         destination.network = networkNum&
  103.         'destination.nodeAddr = physNodeAddress
  104.         destination.nodeAddr.nodeHi = physNodeAddress.nodeHi
  105.         destination.nodeAddr.nodeLo = physNodeAddress.nodeLo
  106.         destination.socket = socketNum
  107.         ccode% = BeginDiagnostics(destination, connID%, compList)
  108.         
  109.         If (ccode% <> SUCCESSFUL) Then
  110.             MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  111.         Else
  112.             offset% = FindComponentOffset(compList, IPX_SPX_COMPONENT)
  113.             ccode% = GetIPXSPXVersion(connID%, offset%, response, ipxResponse)
  114.             If (ccode% = SUCCESSFUL) Then
  115.                 IPXVerLabel.Caption = Format$(Asc(ipxResponse.IPXMajorVersion)) + "." + Format$(Asc(ipxResponse.IPXMinorVersion))
  116.                 SPXVerLabel.Caption = Format$(Asc(ipxResponse.SPXMajorVersion)) + "." + Format$(Asc(ipxResponse.SPXMinorVersion))
  117.             
  118.                 offset% = FindComponentOffset(compList, SHELL_COMPONENT)
  119.                 ccode% = GetShellVersionInfo(connID%, offset%, response, shellResponse)
  120.                 If (ccode% = SUCCESSFUL) Then
  121.                     shellVerLabel.Caption = Format$(Asc(shellResponse.major)) + "." + Format$(Asc(shellResponse.minor)) + Chr$(Asc(shellResponse.rev) + 97)
  122.                 Else
  123.                     shellVerLabel.Caption = "Unknown"
  124.                 End If
  125.             
  126.                 ccode% = EndDiagnostics(connID%)
  127.                 If (ccode% <> SUCCESSFUL) Then
  128.                     MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  129.                 End If
  130.             Else
  131.                 MsgBox "Your workstation is not responding to diagnostics request", MB_OK, "Error"
  132.                 IPXVerLabel.Caption = "Unknown"
  133.                 SPXVerLabel.Caption = "Unknown"
  134.                 shellVerLabel.Caption = "Unknown"
  135.             End If
  136.         End If
  137.     End If
  138. End Sub
  139.  
  140. Sub OKButton_Click ()
  141.     Unload DiagForm
  142. End Sub
  143.  
  144.