IMessengerContact::FriendlyName property
[FriendlyName is no longer available for use as of Windows Vista. See Windows Messenger for more information.]
Retrieves the friendly name of the contact associated with this MessengerContact object.
This property is read-only.
HRESULT get_FriendlyName(
[out, retval] BSTR *pbstrFriendlyName
);
Pointer to a BSTR that contains the friendly name of this user.
Returns one of the following values.
Name | Meaning |
---|---|
|
Success. |
|
pbstrFriendlyName returned a NULL string. |
|
Error returned by VARIANT handling library. |
|
pbstrFriendlyName was a NULL pointer. |
The following table lists error codes returned by this method.
Error Code | Meaning |
---|---|
0x80004005 | pbstrFriendlyName returned a NULL string. |
0x8007000E | String comparison failed. |
The friendly name is used in conjunction with the sign-in name primarily for UI display. Because a friendly name is not guaranteed to be unique, it is good practice to display both the sign-in and friendly names for any contact viewed within a client.
Note
This property is available for scripting languages only in a trusted zone.
The following Visual Basic example shows the use of this method.
Public WithEvents MsgrUIA As MessengerAPI.Messenger
Public MsgrContact As MessengerAPI.IMessengerContact
Private Sub btnFriendlyName_Click()
On Error Resume Next
Dim strSigninName As String
Dim strServiceID As String
'Get selected contact
strSigninName = ListContact.SelectedItem.SubItems(2)
strServiceID = ListContact.SelectedItem.SubItems(5)
sbStatus.Panels.Item(1).Text = "Selected: " & strSigninName & " : " & strServiceID
Set MsgrContact = Nothing
Set MsgrContact = MsgrUIA.GetContact(strSigninName, strServiceID)
ErrorTrap ("GetContact") 'Error handling routine
MsgBox("Contact FriendlyName: " & CStr(MsgrContact.FriendlyName))
ErrorTrap ("Contact.FriendlyName") 'Error handling routine
End Sub
End of client support |
Windows XP |
End of server support |
Windows Server 2003 |
Header |
|
IDL |
|
DLL |
|