Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Timeouts on LPT1

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
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 …
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…
Loops Section Overview

877 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