Share via


DMessengerEvents::OnContactListRemove event

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

Indicates the result of an attempt to remove a contact from the Messenger object's Contact List.

Syntax

void OnContactListRemove(
  [in] LONG      hr,
  [in] IDispatch *pMContact
);

Parameters

hr [in]

Success or error code as a LONG.

An error result for hr might result in all other event parameters being meaningless, NULL, or otherwise invalid. Always check for a successful hr before attempting to use the other event parameters. For a table of MSGR_E* constants, see MSGRConstants.

Possible values are as follows:

Value Meaning
S_OK
A user was successfully removed from the Contact List.
MSGR_E_USER_NOT_FOUND
The contact specified to be removed was not found in the Contact List.
MSGR_E_UNEXPECTED
The server has returned an unexpected error code.
MSGR_E_SERVER_TOO_BUSY
The server is not processing requests or not accepting new connections.
MSGR_E_SERVER_UNAVAILABLE
The server was contacted, but was unavailable for unspecified reasons.
*pMContact* \[in\]
C++ Pointer to a IDispatch interface on the MessengerContact object that corresponds to the removed contact. Using this pointer, clients can now code to its IMessengerContact interface.
VB A MessengerContact object that corresponds to the removed contact.

Return value

This event does not return a value.

Remarks

This event comes in response to the Remove method. If Remove did not return S_OK, no notification is received. For example, attempting to remove a user without specifying a string for username is prevented by the Remove method, which returns E_FAIL even before submission to the protocol and generates no event.

The Microsoft .NET Messenger Service always submits remove requests to the server and does not check local lists first. Other services may check local lists first and issue this event locally without submitting to the protocol for some of the error cases.

Removing a MessengerContact object from the Contact List does not release it from memory or otherwise deallocate it. Clients can deallocate the MessengerContact object as soon as it is removed from the Contact List or later after the client has shut down. A MessengerContact object that is not in the Contact List is still a valid object (for example, it could be used as the VARIANT argument in a InstantMessage call). After the object or contact is out of the Contact List, no status updates will be received from the server about this contact. As a result, when launching an instant message as described, the client will not be able to determine whether that contact is online until the message is sent.

This event is also issued whenever an attempt is made to remove a contact from the Contact List through user action in the UI or through other internal method calls.

To be used when writing custom ::Invoke methods to handle these events.

Parameter vaArgs[x] Variant Type
pMContact 0 VT_DISPATCH
hr 1 VT_I4

Note

This event is available for scripting languages.

Requirements

Minimum supported client
Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
End of client support
Windows XP
End of server support
Windows Server 2003
Product
Messenger 4.5
Header
Msgrua.h
IDL
Msgrua.idl
DLL
Msgsc.dll