Hi All

I have a custom printer driver( not unidriver ) for which I am developing a
USB port monitor. As a homework I tried opening the USB port( USB001 ) from
a console application and CreateFile failed. But same thing worked for LPT1.
I wanted to know if there are seperate set of steps to be followed for USB.
If yes, how do I do it in my port monitor?
If I am missing something, please point me in the right direction.

Thanks and Regards
Vikram

Re: Printing on USB port... by Ram

Ram
Fri Sep 05 23:49:56 CDT 2003

Dear Ashwin,

My printer supports both USB and parallel ports. So should I write seperate
language monitor for USB and parallel?
In DDK it is given that if I use some restricted set of IOCTLs, my Language
monitor becomes portable between the two. How do I distinguish between two
ports when I have a single Language monitor?
Am I missing anything here?
Please let me have your input regarding this problem.

Thanks in advance,
Vikram.

""Ashwin [MS]"" <ashwinn@online.microsoft.com> wrote in message
news:bsvE9U$cDHA.2080@cpmsftngxa06.phx.gbl...
> Why do you need to create your own USB port monitor? The recommended
> approach is to use usbmon which is Microsoft supplied.
>
> - Ashwin
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>



Re: Printing on USB port... by ashwinn

ashwinn
Mon Sep 08 11:17:55 CDT 2003

------=_NextPart_0001_E4530405
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

You just have to make sure in your language monitor that you are calling
the correct functions from the corresponding port monitor for that port.
These functions are returned to the language monitor via the MONITOR2
structure. I suggest that you look at the pjlmon sample in the DDK. This is
a generic language monitor that has nothing to do with the port on which
the printer is installed and works with any port monitor.

- Ashwin

This posting is provided "AS IS" with no warranties, and confers no rights.

------=_NextPart_0001_E4530405
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 You just have to make sure in your language monitor that you are calling the correct functions from the corresponding port monitor for that port. These functions are returned to the language monitor via the MONITOR2 structure. I suggest that you look at the pjlmon sample in the DDK. This is a generic language monitor that has nothing to do with the port on which the printer is installed and works with any port monitor.
\par
\par - Ashwin
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par }
------=_NextPart_0001_E4530405--


Re: Printing on USB port... by Ram

Ram
Tue Sep 09 09:23:57 CDT 2003

Ashwin,

Ok,First let me explain what I understood from your mails.
I will use the usbmon.dll as a port monitor and I'll use my own language
monitor.
I'll handle Openport, Writeport, Readport in my language monitor (So that I
can send my own firmware commands in the LM).
I'll configure USB001 port for my printer.
Now my doubts are,
Where should I specify VID and PID of my printer?
Does usbmon.dll automatically detects the device and communicates with it?

Am I wrong some where? please help me.

Thanks,
Vikram.


""Ashwin [MS]"" <ashwinn@online.microsoft.com> wrote in message
news:hPUgWTidDHA.220@cpmsftngxa06.phx.gbl...
> You just have to make sure in your language monitor that you are calling
> the correct functions from the corresponding port monitor for that port.
> These functions are returned to the language monitor via the MONITOR2
> structure. I suggest that you look at the pjlmon sample in the DDK. This
is
> a generic language monitor that has nothing to do with the port on which
> the printer is installed and works with any port monitor.
>
> - Ashwin
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>



Re: Printing on USB port... by Ram

Ram
Wed Sep 10 08:19:22 CDT 2003

Hi Ashwin,

I am using these API's Insted of INF file.

AddMonitor (for port monitor USBMON.DLL)
ConfigurePort (To configure usboo1 port)
AddMonitor(To add Language Monitor)
AddPrinterDriver (To add driver module)
AddPrinter

It installs the printer properly but now its showing the error
"There was an error found when printing the document "Test Page" to USB001"
and also Please help me where should I specify the VID PID?


Thanks, Vikram.
""Ashwin [MS]"" <ashwinn@online.microsoft.com> wrote in message
news:eO5JQVvdDHA.2080@cpmsftngxa06.phx.gbl...
> Usbmon is installed as part of the "USB Printing Support" when your
printer
> is plugged into the USB port. The USB001 virtual port which is created
> after a printer has been plugged into the USB port will be "monitored" by
> usbmon. As for your VID and PID, I am not sure how they come into the
> picture at the language monitor level. You should include that information
> in your INF. Refer to ntprint.inf to see how other inbox usb printers
> specify their hardware id.
>
> - Ashwin
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>



Re: Printing on USB port... by ashwinn

ashwinn
Wed Sep 10 12:32:19 CDT 2003

------=_NextPart_0001_1E0B101C
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

As I have mentioned in my previous posts, this is one of the problems with
using the AddPrinter/AddPrinterDriver approach. This is exactly why we
recommend that you always use INF based installation mechanisms. I suggest
that you retool your installation to use INFs instead. If you need a
programmatic installation approach, you can either use the one outlined in
KB article 189105 or use SetupDi APIs.

- Ashwin

This posting is provided "AS IS" with no warranties, and confers no rights.

------=_NextPart_0001_1E0B101C
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 As I have mentioned in my previous posts, this is one of the problems with using the AddPrinter/AddPrinterDriver approach. This is exactly why we recommend that you always use INF based installation mechanisms. I suggest that you retool your installation to use INFs instead. If you need a programmatic installation approach, you can either use the one outlined in KB article 189105 or use SetupDi APIs.
\par
\par - Ashwin
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par }
------=_NextPart_0001_1E0B101C--