Solved

Timeouts on LPT1

Posted on 1998-05-15
3
499 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 109
MSDN Subscription - Azure and NFP's 3 85
Need example 5 137
Visual Studio Debugging 3 165
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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