This documentation is archived and is not being maintained.

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.


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

pbstrServiceId

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

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.

Bb758712.note(en-us,office.12).gifImportant:
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.

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());
   }
}

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

Show: