GetServerName method
This method is intended for use with Visual Basic.
- Method
- short GetServerName(
- short Index,
- BSTR * pName )
- Parameters
- Index
- Specifies the zero-based index of the name to be returned. It must be a number greater than or equal to zero and less than the value returned by GetNumServers.
- pName
- Points to a BSTR to receive the name of the server.
- Description
- The specified server name is returned in pName.
GetServerName or GetServerNames can be used to retrieve the server names. An application should use the one which is more convenient in its environment.
- Return Value
- Refer to return codes.
- See Also
- GetNumServers, GetServerNames, and Logon
Visual Basic
Dim rc, count As Integer
Dim num_servers As Variant
Dim Temp As String
.
.
rc = ArsOle.GetNumServers (num_servers)
If rc <> ARS_OLE_RC_SUCCESS Then
MsgBox "ERROR"
End
End If
For count = 0 To num_servers -1
rc = ArsOle.GetServerName(count, Temp)
lbServers.AddItem Temp
Next count
.
.
' During OK button processing
rc = ArsOle.Logon (lbServers.List(lbServers.ListItem), txtUser.Value, txtPasswd.Value)
If rc <> ARS_OLE_RC_SUCCESS Then
MsgBox "ERROR"
End
End If