IMessenger::AutoSignin Method

Deprecated. Signs the local client in automatically using the last sign-in name and saved password information.

Syntax

HRESULT AutoSignin(VOID);

Return Value

For a table of MSGR_E_* constants, see MSGRConstants. Returns one of the following values: 

S_OK Success. See Remarks.
MSGR_E_LOGON_UI_ACTIVE The Sign In dialog box was enabled and visible when this method was called.
S_FALSE Client was already signed in (scripting).
MSGR_E_ALREADY_LOGGED_ON Client was already signed in.
E_FAIL Returned for one of the following reasons:

  • First-time user.
  • No available credentials.
  • Cannot determine local state.
  • Lost connection.
  • Password encoding failed.
  • Unspecified internal error. Cannot access object.

Remarks

This method always signs the user in to the primary service. This method's behavior depends on the primary service on the client. The Microsoft Exchange Instant Messaging Service (IM) client offers users the option to use Exchange as the primary service. The IMessenger::AutoSignin method will not launch the secondary sign-in dialog box for any configured secondary services on any client. Only the primary service can be signed into using this method. To sign in to all services, use IMessenger::Signin. This method will always display the Sign In dialog box, even with cached credentials.

If saving the password locally is not enabled by a specific user option, this method will fail.

This method is used for initial sign-in if necessary, but requires that the sign-in credentials are previously stored by the client user.

If this method fails, implementers can display the Sign In dialog box by calling IMessenger::Signin with NULL strings for sign-in name and password.

Because sign-in relies on server authentication, several possible error conditions are not checked for by the HResult of IMessenger::AutoSignin; instead, they are returned in the IMessenger::Signin event. These error conditions include, but are not limited to, bad credentials stored from the last sign-in attempt, a blank sign-in name or password, and connection problems, each of which is differentiated by the hr parameter of the event. To determine whether the sign-in sequence succeeded, clients should always check both the HResult of IMessenger::AutoSignin and the hr parameter of the IMessenger::Signin event.

Note  The following remarks apply to scripting languages.

  • This method is scriptable.
  • You should not return MSGR_E_NOT_LOGGED_ON to avoid an exception.
  • Clear the value returned to the user.

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