This documentation is archived and is not being maintained.

Loading Contacts without Grouping

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

This sample code snippet from the following complete code sample uses the IMessenger::MyContacts property of the communicator object (Messenger) to get a collection of IMessengerContact objects. The contact object is passed as an argument to the createContactItem method, which retrieves presence information and adds the contact to the contactListView.

  contactCollection = (IMessengerContacts)communicator.MyContacts;
  if (contactCollection != null)
  {
      foreach (IMessengerContact contactItem in contactCollection)
      {
         createContactItem(contactItem);
      }
  }

Show: