Chapter 3
Developing Your Application
© National Instruments Corp.
3-19
NI-488.2M UM for Windows NT
}
Your Win32 application dereferences the pointer to access either the status variables or
function. The following code demonstrates how to call a function and access the status
variable from within your application:
dvm = (*Pibdev) (0, 1, 0, T10s, 1, 0);
if (*Pibsta & ERR) {
printf("Call failed");
}
Before exiting your application, you must free
gpib-32.dll
with the following
command:
FreeLibrary(Gpib32Lib);
For more information on direct entry, refer to the Win32 SDK (Software
Development Kit) documentation.
Microsoft Visual C/C++
After you have written your Win32 application, you must compile the application using
Microsoft Visual C/C++ (version 2.0 or higher). To compile and link a Win32 console
application named
cprog
in a DOS shell, type the following on the command line:
cl cprog.c
To run your application from the Windows environment, select the Run... option from
the Start menu. Enter the path and name of the compiled program in the dialog box that
appears. To run your application from a DOS shell, type the name of your compiled
program on the DOS command line.
Borland C/C++
After you have written your Win32 Borland C/C++ (version 4.0 or higher) application,
compile it using the
-w32
option to create a console application. From the command
line in a DOS shell, type the following command to compile and link a Win32 application
named
cprog
:
bcc32 -w32 cprog.c
To run your application from the Windows environment, select the Run... option from
the Start menu. Enter the name of the compiled program in the dialog box that appears.
To run your application from a DOS shell, type the name of your compiled program on
the DOS command line.