469,592 Members | 2,030 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Printer port solution?

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
Nov 16 '05 #1
3 5235
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.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Joca" <Jo**@discussions.microsoft.com> wrote in message
news:C5**********************************@microsof t.com...
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


Nov 16 '05 #2
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/de...49b7f2.xml.asp
Print Processors DDK Information
http://msdn.microsoft.com/library/de...d22815.xml.asp

Mild Discussion on Print Interception
http://www.osronline.com/lists_archi...hread5378.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
Nov 16 '05 #3
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

"Sushant Bhatia" wrote:
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/de...49b7f2.xml.asp
Print Processors DDK Information
http://msdn.microsoft.com/library/de...d22815.xml.asp

Mild Discussion on Print Interception
http://www.osronline.com/lists_archi...hread5378.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

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Lizard King | last post: by
1 post views Thread by Bow Hunter | last post: by
reply views Thread by Soon Lee | last post: by
reply views Thread by Gustavo | last post: by
reply views Thread by H. Williams | last post: by
4 posts views Thread by Terry Olsen | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.