IMessenger::MyServiceId

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Retrieves the service ID, a globally unique identifier (GUID), of the primary service to which the local client user is currently signed in. Scriptable.

Syntax

HRESULT MyServiceId(
   [out,
   retval] BSTR* pbstrServiceId
);

Parameters

  • pbstrServiceId
    Return value. Pointer to a BSTR that contains a GUID that uniquely identifies the service that the local client user uses.

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.
  • E_FAIL
    A general failure occurred.

Remarks

Important

It is recommended to avoid using the IMessenger::MyServiceId property, but use IMessengerService::ServiceID property instead. To return a list of MessengerService objects, use the IMessenger::Services property.

If the local client is offline, this method returns the service ID of the default service.

Example

This example code reads the MyServiceId property of an IMessenger interface object, communicator. The returned string is displayed on the application console screen.

if (communicator != null)
{
   try
   {
       communicatorServiceID = communicator.MyServiceId;
       Console.WriteLine("Communicator Service ID:" + communicatorServiceID.Trim());
   }
   catch (COMException MSCE)
   {
       Console.WriteLine(MSCE.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

Reference

Interfaces