Solved

Timeouts on LPT1

Posted on 1998-05-15
3
488 Views
Last Modified: 2013-12-03
I am writing a program that gets a handle to the parrallel port using CreateFile and then sends a string of bytes out that port to be printed using WriteFile.  I am trying to incorporate some sort of timeout functionality in this program but ever time I try to call either GetCommTimeouts or SetCommTimeouts I get an error 1: ERROR_INVALID_FUUNCTION.  Is it possible to use these functions when writing out LPT1?  If not is their any way to get some sort of timeout capability on the parallel port?
0
Comment
Question by:toddj
  • 3
3 Comments
 

Accepted Solution

by:
bbarber earned 100 total points
ID: 1402147
You could try settimer to windows.  Every time you receive a response kill the timer then every time you send data set the timer.  If you receive the WM_TIMER message process
it as a error as in time out.
0
 

Expert Comment

by:bbarber
ID: 1402148
if ( 0 == SetTimer ( hWnd, 1, ( UINT )600L, NULL ) )
{
MessageBox(hWnd, "Unable to Initialize Queue Refresh Timer.\r\nAutomatic Refresh of this Queue is disabled.", "Timer Warning!", MB_ICONEXCLAMATION | MB_OK);
                                          }

0
 

Expert Comment

by:bbarber
ID: 1402149
if ( 0 == SetTimer ( hWnd, 1, ( UINT )600L, NULL ) )
{
MessageBox(hWnd, "Unable to Initialize Queue Refresh Timer.\r\nAutomatic Refresh of this Queue is disabled.", "Timer Warning!", MB_ICONEXCLAMATION | MB_OK);
                                          }

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now