Parallel Port access in XP using DeviceIoControl

This is a discussion about Parallel Port access in XP using DeviceIoControl in the Windows Software category; I am writing a simple printing application which opens the LPT1. I am using CreateFile & WriteFile calls to do this. To find out the printer status I am using DeviceIoControl API with IOCTL_PAR_QUERY_INFORMATION code.

Windows Software 5498 This topic was started by ,


data/avatar/default/avatar15.webp

1 Posts
Location -
Joined 2003-08-29
I am writing a simple printing application which opens the LPT1. I am using CreateFile & WriteFile calls to do this. To find out the printer status I am using DeviceIoControl API with IOCTL_PAR_QUERY_INFORMATION code . The problem I am facing is,
 
When ever I restart the m/c the DeviceIoControl API fails (GetLastError returns 1). Then If I go to devicemanager/ports/Port settings and make some changes and click ok, then the application starts working fine. But If restart the m/c again I have to repeat the same thing. whats the problem ???
 
Any help would be appriciated. I am using Windows XP
 
With regards,
Sivaraja T

Participate in our website and join the conversation

You already have an account on our website? To log in, use the link provided below.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This subject has been archived. New comments and votes cannot be submitted.