IMessenger::Phone Method

Deprecated. Launches the Phone Call dialog box.

Syntax

HRESULT Phone(      
    VARIANT vContact,
    MPHONE_TYPE ePhoneNumber,
    BSTR bstrNumber,
    IDispatch **ppMWindow
);

Parameters

  • vContact
    [in] A VARIANT that can take as its value either a VT_BSTR string or a VT_DISPATCH pointer to an existing MessengerContact object. If the input value type is a string, this method creates a new MessengerContact object internally. The string should be the full sign-in name. For a Microsoft .NET Messenger Service contact, this should include the "at" sign (@) and domain name. If the input value type is a pointer to an existing MessengerContact object (should be type VT_DISPATCH), the existing object is used.

  • ePhoneNumber
    [in] A value of the MPHONE_TYPE enumeration that specifies the type of telephone number being called.

  • bstrNumber
    [in] A BSTR that contains the telephone number that will be entered on the text field of the Phone Call dialog box. No validation is performed on this string. The string is expected to follow Telephony Application Programming Interface (TAPI) standards for phone numbers, which are as follows:

    +[countrycode]SPACE[phonenumber]
    

    where:

    • + is the plus character.
    • [countrycode] is any valid country/region code per international phone dialing conventions. An access code should not be supplied in this phone number string. The access code is added by the exchange that initiates the standard telephony portion of the call.
    • SPACE is the space character, CHR(20).
    • [phonenumber] is the phone number within the respective country's exchange, including area or regional codes, as appropriate.
    • Punctuation (except the + sign) should not be provided. Punctuation in [countrycode] or [phonenumber] will be ignored.

    If the bstrNumber parameter is given as a NULL string, the text field of the new dialog box will be initially blank.

  • ppMWindow
    [out, retval] A pointer to a pointer to the IDispatch World Wide Web link interface on a MessengerWindow object, which can be accessed through the IMessengerWindow interface that is used to call other automation-accessible properties, such as IMessengerWindow::Height, IMessengerWindow::Width, IMessengerWindow::Top, IMessengerWindow::Left, and IMessengerWindow::Show. This parameter cannot be null.

Return Value

For a table of all MSGR_E_* constants MSGRConstants, see.

Returns one of the following values:

S_OK Success.
E_FAIL Could not create a Phone Call window.

- or -

Called this method against the local client user.
MSGR_E_NOT_LOGGED_ON Client was not signed in the primary service at the time this method was called.
S_FALSE The Phone Call dialog box is already open.
E_INVALIDARG

vContact is NULL, points to a NULL string, or points to a string that has a space as the first character.

- or -

vContact is a VT_BSTR that exceeded 129 characters.

- or -

vContact is a VT_BSTR and contains a carriage return or linefeed.

- or -

The phone type is out of range.

- or -

bstrNumber exceeds 256 characters.

MSGR_E_PHONESERVICE_UNAVAILABLE The service for the contact you are attempting to call does not support phone calls.
MSGR_E_PHONE_INVALID_NUMBER The contact you are attempting to call does not have the given phone-type number set.
MSGR_E_POLICY_RESTRICTED Microsoft Windows Messenger 5.0 and later. The local computer or local user policy does not allow users to make phone calls.

Remarks

The Microsoft Exchange Instant Messaging Service (IM) cannot support this method. Calling this method on an Exchange service contact will fail.

ppMWindow should be released when it is no longer needed.

Only one Phone Call dialog box can be active at one time. Calling IMessenger::Phone multiple times returns S_OK, not S_FALSE. The phone number displayed in the dialog box will be the phone number entered as a parameter in the most recent method call.

In anticipation of numbers that exceed normal limits because of extensions, key sequences for private uses, and so on, there is no enforcement of string length for the bstrNumber parameter. There is a physical limit to the display of strings in the dialog box.

Note  This method is available for scripting languages.

Important  IMessenger::Phone is no longer available in Windows Vista. See Windows Messenger for more information.