Retrieves the local user's friendly name that corresponds to the selected service. Not scriptable.

Syntax

HRESULT MyFriendlyName(
   [out,
   retval] BSTR* pbstrName
);

Parameters

pbstrName

Pointer to a BSTR containing the friendly name for the local user of this service.

Return Value

Returns one of the following values. For managed code applications, these return values are received in the form of a COMException.

S_OK

Success.

RPC_X_NULL_REF_POINTER

pbstrName is a null pointer.

E_FAIL

pbstrName returns a null string.

E_OUTOFMEMORY

The string comparison failed.

MSGR_E_NOT_LOGGED_ON

This service is offline.

Remarks

This property returns the published name of the currently logged-on user. The published, or friendly, name is the name that is visible to other Office Communicator users. If the Office Communicator UI is offline, querying this property returns MSGR_E_NOT_LOGGED_ON.

Example

In this example, an IMessenger object has been instantiated as communicator. The primary communicator service, thisService, is accessed as an IMessengerService object by querying the IMessengerServices::PrimaryService property on communicatorServices. Finally, the friendly name of the logged-on user is displayed in the application console window.

Copy Code
IMessengerServices communicatorServices;
IMessengerService thisService;
communicatorServices = (IMessengerServices)communicator.Services;
thisService = (IMessengerService)communicatorServices.PrimaryService;

if (thisService != null)
{
	try
	{
		Console.WriteLine("Primary Service MyFriendlyName: " + thisService.MyFriendlyName);
}
	catch (COMException MFNCE)
	{
		Console.WriteLine("COM Exception: " + MFNCE.ErrorCode.ToString());
}
}

Requirements

Client

Requires Microsoft DirectX 9.0, C Runtime libraries (msvcm80.dll) on Microsoft Windows© Vista, Microsoft Windows XP Service Pack 1 (SP1) or later, or Microsoft Windows 2000 with Service Pack 4 (SP4). Any Communicator-imposed restrictions apply. .

Server

Requires Microsoft Office Communications Server 2007, AV MCU (for Media Support), Media Relay (for NAT/Firewall traversal) on Microsoft Office Communications Server 2007.

Product

Microsoft Office Communicator 2007 Automation API

IDL file

Msgrua.idl

See Also