Using NI-DMM in Visual C++
This topic assumes that you are using the Microsoft Visual C++ ADE to manage your code development and that you are familiar with the ADE.
To develop an NI-DMM application in Visual C++, follow these general steps:
- Open an existing or new Visual C++ project.
- Create source files of type .c (C source code) or .cpp (C++ source code) and add them to the project. Make sure that you include the NI-DMM header file, nidmm.h, as follows in your source code files: #include "nidmm.h"
- Specify the directory that contains the NI-DMM header file under the Preprocessor»Additional include directories settings in your compiler—for Visual C++ 6.0 these files are under Project»Settings»C/C++. You can find the installed location of the NI-DMM header files in the NI-DMM Readme File.
- Add the NI-DMM import library nidmm.lib to the project under Link»General»Object/Library Modules. You can find the installed location of the NI-DMM import library files in the NI-DMM Readme File.
- Add NI-DMM function calls to your application.
- Build your application.
Example Programs
You can find the installed locations of example programs in the NI-DMM Readme File. For additional information regarding NI-DMM examples, refer to Examples.
String Passing
To pass strings, pass a pointer to the first element of the character array. Be sure that the string is null-terminated.
Parameter Passing
By default, C passes parameters by value. Remember to pass pointers to variables when you need to pass by address.