Printer port solution?

G

Guest

Hi,

I have a process system that generate events and send them to a printer
port, and in the end a printer writes it as a text line on a paper.

I would like to chatch this text line programatically and process it in my
little application. I would like to know if there are any "Microsoft" objects
or functions to use to get hold of the printer port and the text that comes
from the process ie read the printer port.

Links to tutorials, help files or any other information about this subject
would be much appreachiated

Thanks in advance
Joca
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

Are you really required to use .NET for your task? From what you say, I'd
rather say you need to create a device driver to intercept LPT port
communication - and this is definitely C++ and/or Assembler language. You
can however use the Framework to write the processing application itself,
but as for working with the printer port, you should probably refer to
Windows DDK.
 
S

Sushant Bhatia

Hi Joca.

I've actually written exactly this for someone once. I had to sign a
NDA so I can't give you the code or any samples.

However, you have to use the DDK for your operating system. For
instance if you use WinXP, you need WinXPDDK. The ddk provides example
of print and one in particular that you need to look at is called
genprint. What this means is that you write a driver that captures all
data sent to the printer and if you want to do something with that
data, then you have to send that data to your app.

These links should give u a good start for learning about print
interception. More specifically look into Print Processors.

General Print DDK Information - Good Beginners Guide.
http://msdn.microsoft.com/library/d..._65349c7f-8e59-4d93-b5ff-0b346049b7f2.xml.asp


Print Processors DDK Information
http://msdn.microsoft.com/library/d..._2d9ec794-4d25-4156-863a-ee48ffd22815.xml.asp

Mild Discussion on Print Interception
http://www.osronline.com/lists_archive/ntdev/thread5378.html

If you do a search on GOOGLE GROUPS for genprint, you should see tons
of information on there. I believe that I looked at all the messages
dealing with Print Processors and genprint before I wrote my
component.

By the way, the DDK is available from MS and its quite expensive. If
you have a MSDN Subscribers Download account then you should be ok.


If you have any other questions and if I can help, don't hesitate to
ask...worst case, someone else might be able to give u further
insight. :)

Sushant
 
G

Guest

Many Thanks,

Really nice to know that there are people out there that are so kind and
helpful. I will probably be back with more questions..... perhaps in some
other forum (C++)...

Thanks again
Joca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top