Elo TouchSystems 1525L manual C++ Example, The following is an example of C++

Models: 1525L

1 181
Download 181 pages 9.32 Kb
Page 134
Image 134
C++ EXAMPLE
ret_h; ws; retdw; stage=1;

Section 5. Example Applications

C++ EXAMPLE

The following is an example of C++:

/* --------------------------------------------------------------------------

 

 

 

*/

/*

 

TST: Test Application

*/

/*

 

 

 

 

*/

/*

MTDTEST.C - Test module for Mag-Tek device drivers

*/

/* --------------------------------------------------------------------------

 

 

 

*/

/* Version 1.00

 

 

$Revision::

$ */

/* --------------------------------------------------------------------------

 

 

 

*/

#include <windows.h>

 

 

 

 

#include <stdio.h>

 

 

 

 

#include <conio.h>

 

 

 

 

#include <string.h>

 

 

 

 

/* --- Static variables

-----------------------------------------------------

 

*/

static volatile BOOL

quit = FALSE;

 

 

static char

sbuff[128];

 

 

 

static HANDLE

drv_h;

 

 

 

static HANDLE

in_threadh;

 

 

 

static HANDLE

out_threadh;

 

 

static OVERLAPPED

ov_r, ov_w;

 

 

 

/* --- Macro definitions ----------------------------------------------------

 

*/

#define OPEN_DEVICE(name)

 

 

\

CreateFile(

 

 

 

\

 

(name),

 

/* LPCTSTR - pointer to name of the file */ \

 

GENERIC_READ GENERIC_WRITE,/* DWORD

- access (read-write) mode

*/ \

 

0,

 

/* DWORD

- share mode

*/ \

 

NULL,

 

/* LPSECURITY_ATTRIBUTES

*/ \

 

 

 

/*

- pointer to security attribs */ \

 

OPEN_EXISTING,

 

/* DWORD

- how to create

*/ \

 

0

 

 

 

\

 

FILE_FLAG_OVERLAPPED,

/* DWORD

- file attributes

*/ \

 

NULL

 

/* HANDLE

- template handle

*/ \

 

)

 

 

 

 

/* --- Internal Function Prototypes

-----------------------------------------

*/

void

input_thread

(void *p);

 

 

 

void

output_thread

(void *p);

 

 

 

/* --- Main -----------------------------------------------------------------

 

 

*/

int main ( int argc, char *argv[])

{

HANDLE

DWORD

DWORD int

131

Page 134
Image 134
Elo TouchSystems 1525L manual C++ Example, The following is an example of C++