Creating an Application with Microsoft Visual C/C++ and .NET
- Updated2024-10-09
- 2 minute(s) read
Creating an Application with Microsoft Visual C/C++ and .NET
Creating a C/C++ Application with Microsoft Visual Studio 2008
The ADE that you can use to create applications using Microsoft Visual C/C++ is Microsoft Visual Studio 2008 or later.
To develop an RFmx SpecAn application in Microsoft Visual C/C++, follow these general steps:
- Open an existing or new Visual C/C++ project to manage your application code.
- Create source code files of type .c (C) or .cpp (C++).
- Add the source code files to the project.
- Add following in the source code files: #include "niRFmxSpecAn.h".
- Add the RFmx include and library files to the project. Note In the following steps, <NIDir> is an alias to specific National Instruments file folder locations. Refer to the RFmx SpecAn Readme for more information about installed file locations.Note You can modify an RFmx SpecAn C example to create an application, and all required include and library files are added to the project for you
- Select Project»Properties»Configuration Properties»C/C++»General»Additional Include Directories, and add the path : <NIDir>\Shared\ExternalCompilerSupport\C\include
- Select Linker»Input»Additional Dependencies, and
add niRFmxInstr.lib and
niRFmxSpecAn.lib separated by a space. Note For Visual Studio 2010 and above, add niRFmxInstr.lib and niRFmxSpecAn.lib separated by a semicolon .
- Select Linker»General»Additional Dependencies and add the path: <NIDir>\Shared\ExternalCompilerSupport\C\lib64\msvc;
- Build your application using the appropriate programming flow steps as described in the RFmx Overview topic.
Creating a .NET Application with Microsoft Visual Studio 2010
The ADE that you can use to create applications using Microsoft Visual C# or VB .NET is Microsoft Visual Studio 2010 or later.
To develop an RFmx SpecAn application in Microsoft Visual C# or VB .NET, follow these general steps:
- Open an existing or new Microsoft Visual C# or VB .NET project to manage your application code.
- Create source code files of type .cs (C#) or .vb (VB .NET).
- Add the source code files to the project.
- Use the following RFmx namespaces in the source code files:
- using NationalInstruments.Common;
- using NationalInstruments.RFmx.InstrMX;
- using NationalInstruments.RFmx.SpecAnMX;
- Set the target .NET Framework of your .NET project to 4.0 or higher.
- In Solution Explorer, right click on your project name and click Properties.
- Click on the Application tab and choose .NET
Framework 4.0 or higher from the Target Framework
list. Note Client Profile is not supported.
- Add the following .NET Class Libraries to the project. Note You can modify an existing RFmx C# or VB .NET example to create an application, and all required .NET class libraries added to the project for you.Select Project»Add References, navigate to the .NET tab and add the following files to your project references:
- NationalInstruments.Common.dll
- NationalInstruments.RFmx.InstrMX.Fx40.dll
- NationalInstruments.RFmx.SpecAnMX.Fx40.dll
Note For Visual Studio 2012 and above, navigate to the Assemblies»Extensions tab. - Build your application using the appropriate programming flow steps as described in the RFmx Overview topic.