Using NI-DCPower 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-DCPower 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-DCPower header file, nidcpower.h, in your source code files as follows: #include "nidcpower.h".
- Specify the directory that contains the NI-DCPower 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++. The NI-DCPower header files are located at <IVI>\Include.
- Add the NI-DCPower import library nidcpower.lib to the project under Link»General»Object/Library Modules. The NI-DCPower import library files are located in the <IVI>\Lib\msc directory within your NI-DCPower directory.
- Add NI-DCPower function calls to your application.
- Build your application.
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.