DMessengerEvents::OnContactFriendlyNameChange Event

Deprecated. Indicates that a contact in the client's Contact List has changed the friendly name.

Syntax

void OnContactFriendlyNameChange(      
    LONG hr,
    IDispatch *pMContact,
    BSTR bstrPrevFriendlyName
);

Parameters

  • hr
    [in] Success or error code as a LONG.

    An error result for hr may 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.

  • pMContact
    [in] Pointer to a IDispatch World Wide Web link interface on the MessengerContact object that corresponds to a contact whose friendly name has changed. Using this pointer, clients can now code to its IMessengerContact interface.

  • bstrPrevFriendlyName
    [in] A BSTR that contains the user's previous friendly name.

Return Value

No return value.

Event DISPID

DISPID_MUAE_ONUSERFRIENDLYNAMECHANGE

The DISPID for this event is defined in msgrua.h. Use this value to identify the event handler when implementing IDispatch::Invoke.

Remarks

After receiving this event, the following call should be issued immediately to get the new friendly name of the pMContact object pointer or contact sent by the event.

pMContact->get_FriendlyName

The previous friendly name would be permanently lost if it were not returned in the events. It can be used to qualify the code that might traverse a list or user interface (UI) in a client to make sure that the old friendly name has been removed.

The friendly name is set by the client that corresponds to the remote contact. If the friendly name was changed while the local client was offline, the event is issued upon sign-in.

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

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

Note  This event is available for scripting languages only in a trusted zone.

Important  DMessengerEvents::OnContactFriendlyNameChange is no longer available in Windows Vista. See Windows Messenger for more information.

See Also

DMessengerEvents::OnMyFriendlyNameChange