Elo TouchSystems 1525L manual Example Applications

Models: 1525L

1 181
Download 181 pages 9.32 Kb
Page 138
Image 138
Manual background

Section 5. Example Applications

DWORD

 

read_len=0;

char

 

wbuff[1];

 

char*

 

p;

 

while

(!quit)

 

 

{

 

 

 

rs

= ReadFile(drv_h, wbuff, sizeof(wbuff), &read_len, &ov_r);

if

( !rs)

 

 

 

{

 

 

 

rs = GetLastError ();

 

if ( rs != ERROR_IO_PENDING)

 

{

 

 

 

printf("DeviceIOControl (Read) Error : %i (0x%x)\n", rs, rs );

 

break;

 

 

 

}

 

 

 

}

 

 

rs

= WaitForSingleObject ( ov_r.hEvent, INFINITE);

rs

= GetOverlappedResult (

 

drv_h,

 

// handle of file, pipe, or communications device

 

&ov_r,

 

// address of overlapped structure

 

&read_len,

// address of actual bytes count

 

FALSE

 

// wait flag

 

);

 

 

if

(quit)

 

 

 

 

break;

 

if

( rs )

 

 

 

{

 

 

 

p = wbuff;

 

 

while (read_len >0)

 

{

 

 

 

if (*p == 0x1a)

 

{

quit = TRUE; printf("\n\nExiting Test..."); break;

}

putch (*p); ++p; --read_len;

}

}

}

};

// end of file

135

Page 138
Image 138
Elo TouchSystems 1525L manual Example Applications