Source Code Tab - Edit C/C++ DLL Call Dialog Box
- Updated2025-07-21
- 3 minute(s) read
Source Code Tab - Edit C/C++ DLL Call Dialog Box
Source Code Tab
Use the Source Code tab to generate the source code for the DLL function, edit the source code, and resolve differences between the parameter list in the source code and the parameter information on the Module tab. TestStand can call the step code module even if you do not use the Source Code tab.
The Source Code tab contains the following options:
- Create Code in Text File (Functions Only) —Select this option when you want the C/C++ DLL Adapter to create and edit code using the default application Microsoft Windows associates with the file extension. When you select this option, you only specify the source file containing the function. When you select this option, the C/C++ DLL Adapter uses the C/C++ code template associated with the step type to create code. You cannot use this option to create C++ class methods.
- Create Code in Microsoft Visual Studio —Select this option when you want the C/C++ DLL Adapter to create and edit code using a fully integrated interface with Microsoft Visual Studio. When you select this option, you must specify the source file and project file that contains the function. Optionally, you can also specify a Visual Studio solution file. When you select this option, the C/C++ DLL Adapter uses the Visual C++ .NET code template associated with the step type to create code.
- Source File that Contains Function —The pathname of the source file. You must specify an existing source file when creating code in Visual Studio. If you want to create a new source file in a text file, you must enter an absolute pathname. If you are using an existing source file, you can enter an absolute or relative pathname. Relative pathnames are relative to the TestStand search directory paths. Use the Edit Search Directories dialog box to customize the search directory paths .
- Microsoft Visual Studio Project File —The pathname of the project file. You must specify an existing project file. You can enter an absolute or relative pathname. Relative pathnames are relative to the TestStand search directory paths.
- Visual Studio Solution File —The pathname of the solution file. You must specify an existing solution file. You can enter an absolute or relative pathname. Relative pathnames are relative to the TestStand search directory paths.
-
Create Code
—Creates the source code shell for the function. You must specify an existing source file when creating code in Visual Studio. If the source file you specify does not already exist when creating code in a text file, the adapter creates it. If the file already exists, the C/C++ DLL Adapter appends the function to the end of the file. If a code template file exists for the step type you are using for the step, the C/C++ DLL Adapter uses the template to create the shell of the new function. If the project file you specify is not in the solution, the C/C++ DLL Adapter prompts you to add it. If the source file you specify is not in the project, the C/C++ DLL Adapter prompts you to add it. If you already have the source code for the function, click
Edit Code
.
If template source code exists for the step type you use for the step, the adapter inserts the parameter information from the template source code into the new function shell. The adapter also uses the template parameter list to complete the parameter information on the Module tab. If the step type does not have a code template, TestStand uses the default template for the C/C++ DLL Adapter. When the Module tab already contains parameter information that differs from the parameter list in the template, the C/C++ DLL Adapter launches a dialog box in which you can resolve the conflict. Enable Use Prototype from Module Tab when you want to use the prototype the Module tab specifies.
When the C/C++ DLL Adapter creates the code, the adapter launches the application currently registered on the system for the type of the file, such as Visual Studio for .cpp files, and displays the file in the application.
- Edit Code —Edits the source code for the function if the source code already exists.
- Verify Prototype —Checks for any conflicts between the source code and the parameter information on the Module tab.
- Use Prototype from Module Tab —TestStand ignores the code template prototype and to use the prototype the Module tab specifies.