Share via


IMessengerContacts::Count property

[Count is no longer available for use as of Windows Vista. See Windows Messenger for more information.]

Retrieves the number of MessengerContacts objects in the collection.

This property is read-only.

Syntax

HRESULT get_Count(
  [out, retval] long *pcContacts
);

Property value

LONG that provides the number of MessengerContacts objects in the collection.

Error codes

Returns one of the following values.

Name Meaning
S_OK
Success.
RPC_X_NULL_REF_POINTER
pcContacts is a NULL pointer.

Remarks

If there are no active MessengerContacts objects in the Contact List, pcContacts will return zero.

If this method is called while the client is offline, the method call will not fail, but the Contact List will always have zero members and zero count.

Note

This property is available for scripting languages.

Examples

The following Visual Basic example shows the use of this method.

Public WithEvents MsgrUIA As MessengerAPI.Messenger
Public MsgrContacts As MessengerAPI.IMessengerContacts

Private Sub btnCount_Click()
    On Error Resume Next
    MsgBox("Contacts Count = " & CStr(MsgrContacts.Count))
    ErrorTrap ("Contacts.Count")    'Error handling routine
End Sub

Requirements

End of client support
Windows XP
End of server support
Windows Server 2003
Header
Msgrua.h
IDL
Msgrua.idl
DLL
Msgsc.dll

See also

IMessengerContacts

Item