Microsoft c/c, Borland c/c, Microsoft c/c++ -3 borland c/c++ -3 – National Instruments NI-DNET User Manual

Page 22

Advertising
background image

Chapter 3

Developing Your Application

© National Instruments Corporation

3-3

NI-DNET User Manual

Microsoft C/C++

The NI-DNET software supports Microsoft Visual C/C++ version 6.

The header file and library for Visual C/C++ 6 are in the

MS Visual C

folder of the

NI-DNET

folder. The typical path to this folder is

\Program

Files\National Instruments\NI-DNET\MS Visual C

. To use

NI-DNET, include the

nidnet.h

header file in your code, then link with

the

nidnetms.lib

library file.

For C applications (files with a

.c

extension), include the header file by

adding a

#include

to the beginning of your code, as in:

#include "nidnet.h"

For C++ applications (files with

.cpp

extension), define

_cplusplus

before including the header, such as:

#define _cplusplus

#include "nidnet.h"

The

_cplusplus

define enables the transition from C++ to the C language

NI-DNET functions.

The reference for each NI-DNET function is provided in the NI-DNET
Programmer Reference Manual
, which you can open from Start»All
Programs»National Instruments»NI-DNET
. You can find examples for
Visual C++ in the

examples

subfolder of the

MS Visual C

folder. Each

example is in a separate folder. A

.c

file with the same name as the

example contains a description the example in comments at the top of the
code. At the command prompt, after setting MSVC environment variables
(such as with MS

vcvars32.bat

), you can build each example using a

command such as:

cl –I.. singin.c ..\nidnetms.lib

Borland C/C++

The NI-DNET software supports Borland C/C++ version 5 or later.

The header file and library for Borland C/C++ are in the Borland C folder
of the NI-DNET folder. The typical path to this folder is

\Program

Files\National Instruments\NI-DNET\Borland C

.

To use NI-DNET, include the

nidnet.h

header file in your code, then link

with the

nidnetbo.lib

library file.

Advertising