' Indicates a Windows NT Advanced Server could not be contacted or that
' objects within the domain are protected such that necessary
' information could not be retrieved.
Const ERROR_CANT_ACCESS_DOMAIN_INFO = 1351&
Private Sub Command1_Click()
Dim nStatus As Long
Dim bytOld() As Byte
Dim bytNew() As Byte
bytOld = "oldpwd" & Chr(0)
bytNew = "newpwd123" & Chr(0)
nStatus = NetUserChangePassword("domain", "user", bytOld(0), bytNew(0))
' //
' // If the call succeeds, inform the user.
' //
If nStatus = NERR_Success Then
MsgBox "OK!"
Else
MsgBox "Err!"
End If