Re: virtual com driver by MohdMoinuddinPasha
MohdMoinuddinPasha
Mon Sep 18 00:01:02 CDT 2006
hi Kevin,
Thank you, it looks like my problem is solved. I will come back If i face
some problem. Thank You Once Again.
Regards,
"Kevin" wrote:
> "Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
> in message news:A7486484-064F-4FFC-8A22-3C99714BB944@microsoft.com...
> >
> > "Kevin" wrote:
> > >
> <snip>
> > >
> > > So, here is my suggestion: set the printer Port to a file-name, then
> have a
> > > user-level app create a named-pipe with that file-name in
> > > %systemroot%\system32. When an application prints to that file-name,
> your
> > > user-level app will receive the data via the named-pipe, and write it to
> the
> > > USB port via your customized USB Interface functions.
> > >
> >
> > Hi Kevin,
> >
> > Thanks and I think ur suggestion is just right for my requirement.
> > I you do one more favor by sending in the details how to set a file-name
> to
> > a printer port
>
> When you assign the Printer Port, go to Add Port / Local Port, and enter a
> filename, like "MYPPORT". This file will be written to in
> %SYSTEMROOT%\system32 by the Windows spooler. If the file / named-pipe does
> not exist, the spooler will create it as a normal file when it first
> attempts to print to a printer using that file as the port. You will need
> to make sure the named-pipe exists before the spooler tries to print to that
> port.
>
>
> > and how does our application get notification of when the data
> > arrives to that file or we need to write a thread which monitors
> constantly.
>
>
> You write a normal application that uses CreateNamedPipe() with that same
> name in that same directory. This application then waits for data via
> ReadFile().
>
> A "pipe" is just like a "file", except that it only has "contents" when some
> other program writes to it (using CreateFile() and WriteFile()).
>
> So, whatever the spooler writes to that file will appear in your application
> from ReadFile(), which you then use with your custom USB Interface function
> to send to your printer.
>
>
>
>