Programming example for windows nt, Programming example for windows nt -12 – Rockwell Automation 1747-PCINT API Software for 1746 I/O User Manual
Page 38
3–12
Developing Applications
Publication 1747-6.5.3 June 1998
Programming
Example for
Windows NT
The following Windows NT example (
sample.c
on your Windows NT API disk)
shows how to program the above steps. Callouts on the right margin identify the
code for each step.
/********************************************************************
* Title: Simple application sample code for 1746 I/O PCI Interface API
*
* Abstract:
*
* This file contains a simple application using the PCI
* bus interface API.
*
* Environment:
* 1747-PCIS 1746 I/O PCI Interface
* Microsoft Windows NT 4.0
* Microsoft Visual C++ / Borland C++
* (c)Copyright Allen-Bradley *
************************************************************************/
/*=======================================================================
= INCLUDE FILES =
=======================================================================*/
#include
#include
#include
#include
#include
#include
#include
#include "ocapi.h"
/*=======================================================================
= MODULE WIDE GLOBAL VARIABLES =
=======================================================================*/
HANDLE OChandle;
OCIOCFG OCcfg;
/************************************************************************
* Entry point:
* Ioexit
*
* Description:
* Common error handling routine. This routine displays any
* extended error and exits the program.
*
* Arguments:
* rc : int ( input )
* This error code is passed to the exit() routine.
*
* External effects:
* The program is terminated.
*
* Return value:
* none
*
* Access: Public
* -----------------------------------------------------------------------
* Notes:
*
*************************************************************************/
void Ioexit
int rc
) {
OCEXTERR exterr;
char *msg;