LPT1: Cannot access the port

LPT1: Cannot access the port

Post by Jack C Shofne » Wed, 06 Nov 2002 03:34:06



Hi,
I have two apps that will be running continuously.  One is
a third party app, and the other app is one that I am
programming in .NET.  The third party gains control of
LPT1, which does not allow my app to have access to it.  
When my app writes to LPT1:  I get this error message
     "There was an error writing to LPT1: for the printer
(EPSON TM-T88II(R) Receipt:  Cannot access the port.  It
may be in use by another program.  Quit other programs and
try printing again."
     The knowledge base article, Q127027, states that the
transmission retry field in printer properties needs to be
increased greater than 90.  This was done without
success.  We also tried sharing the printer.  This did not
work either.  
  Is there a way in .NET or the API to make the third
party app give up control of the LPT1: port for a short
time, so that my app can use the port?
 
 
 

LPT1: Cannot access the port

Post by Thomas Scheidegger [MVP] NETMaste » Wed, 06 Nov 2002 04:24:51


Is this a .NET specific issue?

What happens if you try to print using e.g. Notepad?
I guess you will have the same problem ...

Thus ask the vendor of the 'third party app'
to fix this issue.

AFAIK there is no API for forcing any other application
to (temporally) close its handles to the device.

It also depends how your 'third party app' and .NET app
tries to open the printer: via spooler? / direct port?

--
 Thomas Scheidegger - MVP .NET - 'NETMaster'
 http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/


Quote:> I have two apps that will be running continuously.  One is
> a third party app, and the other app is one that I am
> programming in .NET.  The third party gains control of
> LPT1, which does not allow my app to have access to it.
> When my app writes to LPT1:  I get this error message
>      "There was an error writing to LPT1: for the printer
> (EPSON TM-T88II(R) Receipt:  Cannot access the port.  It
> may be in use by another program.  Quit other programs and
> try printing again."
>      The knowledge base article, Q127027, states that the
> transmission retry field in printer properties needs to be
> increased greater than 90.  This was done without
> success.  We also tried sharing the printer.  This did not
> work either.
>   Is there a way in .NET or the API to make the third
> party app give up control of the LPT1: port for a short
> time, so that my app can use the port?


 
 
 

1. Cannot debug - Unable to launch. Cannot find port.

I have installed VS.net on a Win98 machine.  I am able to compile and run a
windows forms app, but cannot dedug it in the IDE.  The error message I receive
is "Unable to launch. Cannot find port.  Check the remote machine name."  I am
not able to find any information on how to find or change the remote machine
name - according to the MSDN docs, this should be on the "Debug" properties page,
but it is not there.

Any suggestions for me?

2. At last - a NBNS/WINS server that supports OS/2 clients!

3. How to send characters to lpt1:

4. DLLs not terminated in correct sequence (OS/2 bug?)

5. Problem accessing Access db - Cannot obtain lock

6. NEWSGROUP IS DEAD?

7. Compact Framework Cannot Access Pure Access (mdb) Database

8. 4th Annual Object Application Awards

9. accessing parallel ports in .Net

10. Serial Port Access in .NET

11. Comm port access ??

12. COM port access on IPAQ and CF in VB

13. access COM port from compactframework