Log in/Log out Execution

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

The log in and log out procedure is implemented as a Front-End callback sequence, in which a sequence you call from the application contains the code that prompts the user for a login and processes the login. Call the LoginLogout Front-End callback when the application starts, when you want to give the user the ability to log in or log out, and when you want the user to log out before you shut down the engine. You call the LoginLogout callback by using the Engine.CallFrontEndCallbackEx method and passing LoginLogout for the sequenceNameParam parameter.

The LoginLogout callback logs out the currently logged-in user. Depending on the value of the arguments in the argumentList parameter, the LoginLogout callback can also log in a new user.

ArgumentList Parameter

The argumentList parameter to the Engine.CallFrontEndCallbackEx method is a property object that contains a set of subproperties. Each subproperty represents an argument. To create the PropertyObject object for the argumentList parameter, call the Engine.NewPropertyObject method as follows:

NewPropertyObject (PropValType_Container, False, "", 0)

Call the PropertyObject.SetValBoolean method on the newly created PropertyObject to specify the value of the first argument, logoutOnly. You can choose a True or a False setting, as shown in the following examples:

  • SetValBoolean ("logoutOnly", PropOption_InsertIfMissing, True)
  • SetValBoolean ("logoutOnly", PropOption_InsertIfMissing, False)

Finally, call the PropertyObject.SetValBoolean method to specify the value of the second argument, isInitialLogin. This argument indicates whether this is the initial login at application startup. The callback uses this information to implement the Automatically Login Windows System User feature for Microsoft Windows.

After you call the Engine.CallFrontEndCallbackEx method, release the PropertyObject you created for the argumentList parameter.

Special Handling of the User Interface Message UIMsg_EndExecution

To determine when a log out or log in/log out operation has completed, keep track of the Execution.Id property of the execution the Engine.CallFrontEndCallbackEx method returns. When you receive the UIMsg_EndExecution user interface message, you can use this handle to determine whether the completed execution is the Front-End callback you created. If you know when the LoginLogout callback completes, you can perform the following tasks:

  • Update the display to show the name of the currently logged-in user. Obtain the User object for the current user from the Engine.CurrentUser property and then obtain the name of the user from the User.LoginName property. You can also use the User.FullName property if you prefer.
  • Process command-line arguments after a user has logged in.
    Tip  Do not load a sequence file or run an execution in response to command-line arguments until you give the user a chance to log in.
  • Shut down after the last user logs out.
  • Update the state of menu items and other controls that depend on user privileges. You must re-evaluate menu items and other controls that relate to process model entry points. The results of the name expressions and enabled expressions for entry points can vary depending on the current user.


Not Helpful