Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Timeouts on LPT1

Posted on 1998-05-15
3
Medium Priority
?
501 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 400 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

715 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