Accessing Properties Using API - MFC
- Updated2025-07-23
- 2 minute(s) read
Purpose
This example shows how to access built-in and dynamic TestStand properties. Built-in TestStand properties are defined by the TestStand API, and are available for any object of a given class. Dynamic properties, also known as SubProperties, can vary between objects of the same class.
Example File Location
<TestStand Public>\Examples\TestStand API\Accessing Properties Using API\MFC\Accessing Properties Using API.seq
Highlighted Features
- Built-In Properties
- Dynamic Properties
- RunState Property
- TestStand API
Major API
- PropertyObject.GetValNumber
- PropertyObject.GetValString
- PropertyObject.SetValNumber
- PropertyObject.SetValBoolean
- PropertyObject.SetValVariant
Prerequisites
None
How to Use This Example
AppWizard creates AccessingPropertiesAndVariables.dll, which demonstrates the basics of using the Microsoft Foundation Class (MFC) Library and serves as a starting point for writing a custom DLL.
The following files, located in the <TestStand Public>\Examples\TestStand API\Accessing Properties Using API\MFC directory, make up AccessingPropertiesAndVariables.dll:
- AccessingPropertiesAndVariables.h—The main header file that declares the CAccessingPropertiesAndVariablesApp class for the DLL.
- AccessingPropertiesAndVariables.cpp—The main DLL source file that contains the CAccessingPropertiesAndVariablesApp class.
- AccessingPropertiesAndVariables.rc—A list of all the Microsoft Windows resources the program uses, including icons, bitmaps, and cursors stored in the res subdirectory. You can directly edit this file in Microsoft Developer Studio.
- res\AccessingPropertiesAndVariables.rc2—Contains resources Developer Studio does not edit. Place all resources the resource editor cannot edit in this file.
- AccessingPropertiesAndVariables.def—Contains DLL information that must be provided to run with Windows. This file defines parameters such as the name and description of the DLL and exports functions from the DLL.
- AccessingPropertiesAndVariables.clw—Contains information ClassWizard uses to edit existing classes, add new classes, and store information required to create and edit message maps and dialog data maps and to create prototype member functions.
Other standard files located in the <TestStand Public>\Examples\Accessing Properties Using API\MFC directory include the following:
- StdAfx.h and StdAfx.cpp—Used to build a precompiled header (PCH) file named AccessingPropertiesAndVariables.pch and a precompiled types file named StdAfx.obj.
- Resource.h—The standard header file that defines new resource IDs. Developer Studio reads and updates this file.