Accessing Arrays Using API - MFC
- Aktualisiert2025-07-23
- 2 Minute(n) Lesezeit
Purpose
This example demonstrates how to use the TestStand API from a Microsoft Foundation Class (MFC) Library code module to access a one-dimensional array, two-dimensional array, and an array of strings in TestStand.
Example File Location
<TestStand Public>\Examples\TestStand API\Accessing Arrays Using API\MFC\Accessing Arrays Using API.seq
Highlighted Features
- C/C++ DLL Adapter
- TestStand API
Major API
- PropertyObject.NewSubProperty
- PropertyObject.GetValVariant
- PropertyObject.SetValVariant
Prerequisites
None
How to Use This Example
AppWizard creates AccessingArrays.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 Arrays Using API\MFC directory, make up AccessingArrays.dll:
- AccessingArrays.h—The main header file that declares the CAccessingArraysApp class for the DLL.
- AccessingArrays.cpp—The main DLL source file that contains the CAccessingArraysApp class.
- AccessingArrays.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\AccessingArrays.rc2—Contains resources Developer Studio does not edit. Place all resources the resource editor cannot edit in this file.
- AccessingArrays.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.
- AccessingArrays.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\AccessingArraysUsingAPI\UsingMFC directory include the following:
- StdAfx.h and StdAfx.cpp—Used to build a precompiled header (PCH) file named AccessingArrays.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.