Additional Information
For backwards compatibility, all Visual Studio examples are organized using a Visual Studio 2005 solution file. The different examples are then organized as projects within that solution. To facilitate that Visual Studio 2005 solution and its structure with newer versions of Visual Studio, you might need to perform some upgrade steps. As an example, the upgrade steps for Visual Studio 2022 are:
1. Go to the Windows folder
C:\Users\Public\Documents\National Instruments\NI-VISA\Examples\C
and open Examples_MSVC_VS2005.sln using Visual Studio 2022.
2. Allow Visual Studio 2022 to automatically upgrade the solution.
3. Manually add the NI-VISA libraries to the projects' dependencies.
- Within Visual Studio 2022, in the Solution Explorer, choose one of the listed projects. Expand the file tree to show Library Files.
- Right-Click on Library Files. In the Context Menu, choose Add, then Existing Item...
- A file dialog window opens. Within the dialog, add one or both of the following files:
for x64 compilations:
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Lib_x64\msc\nivisa64.lib
for x32 compilations:
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\lib\msc\visa32.lib
- You will have to add the NI-VISA libraries for each project separately. To do that quick, after the first import, you can drag-and-drop or copy-paste the library files within the Solution Explorer.
drag-and-drop:
Press (and hold) the CTRL key. With the left Mouse button, click on the library file and hold the button. Now move the Mouse until it hovers over another project's Library Files folder. Release the Mouse button.
copy-paste:
Right click on the library file. Within the context menu, choose Copy. Afterwards, right click on another project's Library Files folder. Within the context menu, choose Paste.