IMessengerPrivate::AddContact Method

Deprecated. Adds a contact to the contact list with no prompting or notification user interface (UI).

Syntax

HRESULT AddContact(      
    BSTR bstrSiginName,
    VARIANT vService
);

Parameters

  • bstrSiginName
    [in] BSTR that defines the sign-in name of the contact to be added. The method will run regardless of whether this parameter is valid. The DMessengerPrivateEvents::OnContactListAdd event will contain the results from this method call.
  • vService
    [in] VARIANT that defines the service. For more information, see Remarks.

Return Value

Returns one of the following values.

S_OK The contact was added to the contacts list.
E_POINTER The parameter bstrSiginName resolved to a null value.
E_INVALIDARG The parameter bstrSiginName is not valid for this method.
MSGR_E_NOT_LOGGED_ON The service is not logged on.
E_FAIL The method call has failed due to a catastrophic error.
MSGR_E_API_LOCKED Microsoft Windows Messenger 5.0 and later. The application has called the Microsoft .NET Messenger Service without unlocking it. For more information, see Messenger Lock and Key API.

Remarks

The vService parameter can be specified as a BSTR containing the ID (not the name) of the service, or it can also be a pointer to an IDispatch World Wide Web link of a MessengerService object.

Note  This method is not available for scripting languages.

Important  IMessengerPrivate::AddContact is no longer available in Windows Vista. See Windows Messenger for more information.

See Also

IMessengerPrivate::EnableAlertEvents, DMessengerPrivateEvents::OnContactListAdd, Messenger Lock and Key API, Messenger Session Invite and Messenger Private APIs