Retrieves the friendly (display) name of the local client user, which can be called from a script not running inside a Web page.
Syntax
HRESULT MyFriendlyName( [out, retval] BSTR* pbstrName ); |
Parameters
- pbstrName
-
Return value. Pointer to a BSTR that contains the current user's friendly name.
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_OUTOFMEMORY
-
The string comparison failed.
- E_FAIL
-
The local user is disconnected.
Remarks
If the local client is offline when the IMessenger::MyFriendlyName property is called, the call returns the HRESULT or COMException MSGR_E_NOT_LOGGED_ON.
Even when online, this property does not recheck the user store for the current user's friendly name. The value returned is always the value sent through the protocol on the initial primary service sign-in.
Example
The code example illustrates the querying of the MyFriendlyName property of communicator, a IMessenger interface object.
Copy Code | |
---|---|
string myFriendlyName = null; try { myFriendlyName = communicator.MyFriendlyName; } catch (COMException FNCE) { Console.WriteLine(FNCE.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