IMessengerService::ServiceName Property

[ServiceName is no longer available in Windows Vista. See Windows Messenger for more information.]

Retrieves the service name of the contact associated with this MessengerContact object.

This property is read-only.

Syntax (get)

HRESULT get_ServiceName(
  [out, retval]  BSTR *pbstrServiceName
);

Parameters

pbstrServiceName [out]

Pointer to a BSTR containing a string that identifies the service used by this contact.

Return Value

Returns one of the following values. 

Return codeDescription
S_OK

Success.

RPC_X_NULL_REF_POINTER

pbstrServiceName is a NULL pointer.

E_FAIL

General failure.

E_OUTOFMEMORY

Internal string copy failed.

 

Remarks

The following table lists error codes returned by this method.

Error CodeMeaning
0x80004005General internal failure.
0x8007000EInternal string copy failed.

 

This method is useful for obtaining human-readable, service-identifying strings to be used in the UI.

Note  This property is available for scripting languages.

Examples

The following Visual Basic example shows the use of this method.


Public WithEvents MsgrUIA As MessengerAPI.Messenger
Public MsgrService As MessengerAPI.IMessengerService

Private Sub btnServiceServiceName_Click()
    On Error Resume Next
    MsgBox("Service Name: " & MsgrService.ServiceName)
    ErrorTrap ("MsgrService.Name")	'Error handling routine
End Sub

Requirements

Header

Msgrua.h

IDL

Msgrua.idl

DLL

Msgsc.dll

See Also

IMessengerService
ServiceID

 

 

Send comments about this topic to Microsoft

Build date: 6/30/2010

Show: