Returns the IMessengerService object for the primary service for the primary client. Scriptable.
Syntax
HRESULT PrimaryService( [out, retval] IDispatch** ppService ); |
Parameters
- ppService
-
Address of a pointer to an IMessengerService interface that represents the primary 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
-
ppService is a null pointer.
Remarks
The primary service is the service used when the IMessenger::AutoSignin method is called. This object can be obtained from an active Messenger object. It is not necessary that a user is logged on when the PrimaryService property is queried. To gain access to this property, you must first instantiate an IMessenger and then a IMessengerServices object.
Example
The following example code uses an instance of the IMessenger object, communicator, to retrieve a collection of IMessengerService objects. The communicatorServices property, PrimaryService, is queried to retrieve the IMessengerService object representing the primary service used by the logged-on user.
Copy Code | |
---|---|
IMessengerServices communicatorServices; IMessengerService thisService; communicatorServices = (IMessengerServices)communicator.Services; if (communicatorServices != null) thisService = (IMessengerService)communicatorServices.PrimaryService; |
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