Signing Out from a Communications Server

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.

An application can call the IMessenger::Signout method to sign out of a Communicator account from the connected communications service. The effect is the same as when a user logs out of the server by clicking Sign Out on the Connect menu in Communicator.

It is important that the application releases any unmanaged resources that becomes out-of-scope if the user signs out.

C# Code Example for Signing Out

// Global or class variable
CommunicatorAPI.Messenger communicator;
bool connected = false;

// A simple implementation of signing out.
void Signout()
{
   if (!connected)
      return;

   if (communicator == null)
      return;

   communicator.Signout();
}

// Event handler for OnSignout event
void communicator_OnSignout()
{
    connected = false;
    // Release the unmanaged resource.
    Marshal.ReleaseComObject(communicator);
    communicator = null;
}

See Also

Reference

DMessengerEvents::OnSignout