[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

LPT1: Cannot access the port

Jack Shofner

11/4/2002 7:34:00 PM

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?

1 Answer

NETMaster

11/4/2002 8:24:00 PM

0

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_d... - http://dnetm...





"Jack C Shofner" <JSHOFNER@SCM.NET> wrote in message news:b57101c28430$c1c0a640$35ef2ecf@TKMSFTNGXA11...
> 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?