none
Not able to see LPT port on print dialog box in wince 6.0 r2 RRS feed

  • Question

  • I have builded my osdesign and i got following things

    1. pcl.dll

    2. usbfn.dll

    i have added following registry in my platform.reg

    [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default\Default\7\Printer_Class]
        "DLL"="USBPRN.DLL"
        "Prefix"="LPT"
    [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Printer_Class]
        "DLL"="USBPRN.DLL"
        "Prefix"="LPT"

    but when i load nk.bin on by wince 6.0 r2 device and clicked wordpad and trying to print it is showing following option

    1.PCL Laser

    2. port

    a. Com1 : 9600

    b. com1: 57600

    c. IRDA

    c. Neto

     

    it is not showing LPT.

    According to following link it should register itself.

    http://msdn.microsoft.com/en-us/library/ms893845

    i think my printer is not able to print because of this missing of LPT on list

    Can anybody tell me how to get this LPT and make my printer working.?

    • Moved by Jesse Jiang Thursday, April 21, 2011 2:39 AM (From:Visual Studio Smart Device Development - Native C++ Project)
    Tuesday, April 19, 2011 11:51 AM

All replies

  • Hello,

     

    I think your issue should be raised in the Windows Embedded Compact Platform Development I believe they will know more information of this issue than us, and I will move this one to that forum.

     

    Thanks for your understanding,

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 21, 2011 2:38 AM
  • You don't seam to have the required 'usbprn.dll' driver included in your OS Desin

    In order to get the USB Printer class driver (usbprn.dll) loaded you have to make sure you have the following components selected:
    "USB Printer Class Driver" (located under Core OS -> CEBASE -> Core OS Services -> USB Host Support)

    This will make sure that the usb printer class driver gets loaded when a compatible USB printer is attached.


    MVP Windows Embedded
    Friday, April 22, 2011 7:00 PM
  • The USB printer becomes available only if the printer is turned on and attached to the CE device. Then, the LPT port of this USB printer only appears if it is ready for printing. Also, verify if the USB drivers are correctly loaded by checking the registry: HKLM\Drivers\Active At0s
    At0s
    Wednesday, April 27, 2011 11:31 AM
  • Hi,

    Thanks for the reply.

    We did not find any registry entry with the name of "HKLM\Drivers\Active".

    Could you tell me where can we find this entry.?

    Thursday, May 5, 2011 9:27 AM
  • Hi Michael,

    We have selected "USB Printer Class Driver" in catalog items.

    We have added printer driver registry entry in platform.reg fiel regarding "LPT1:" port.

    Registry Settings:

    [HKEY_LOCAL_MACHINE\Printers\Ports]
        "Port1"="COM1: 9600"
        "Port2"="COM7: 57600"
        "Port3"="NET0:"
        "Port4"="LPT1:"
       
    [HKEY_LOCAL_MACHINE\Printers\Settings]
        "TimeOut"=dword:1E
    [HKEY_LOCAL_MACHINE\PrintSettings]
        "TimeOut"=dword:2D
    [HKEY_LOCAL_MACHINE\Printers]
        "DefaultPrinter"="PCL Laser"
       
    [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default\Default\7\Printer_Class]
       "Prefix"="LPT"
       "Dll"="USBPRN.DLL"
    [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Printer_Class]
       "Prefix"="LPT"
       "Dll"="USBPRN.DLL"
      
     [HKEY_LOCAL_MACHINE\Printers\PCL Laser]
        "Driver"="pcl.DLL"
        "High Quality"="300"
        "Draft Quality"="150"
        "Color"="Monochrome"
        "Version"="0x200"

    Now we are able to LPT1 port in print dailog box. So we are selecting PCL Laser as printer type and port as "LPT1:".

    Our Observations:

    1) It is loading pcl.dll and trying to open "LPT" driver. But it is failing to open LPT driver.

    2) It is returning error code as 55 i.e. unable to open COM port.

    3) This LPT driver is part of USBPRN.dll file. So as per our understandings It is able to create this dll but not able to load on to kernel, which causing unable to open port error.

     

    So, please suggest us how to load this dll. We tried by doing manual loading of dll using LoadLibrary.But it is returning NULL.

     

    Regards,

    Shiva

    Thursday, May 5, 2011 9:35 AM
  • Hi Shiva

    Don't add "LPT1:" to the [HKEY_LOCAL_MACHINE\Printers\Ports] key manually when using a USB printer. The USB Printer driver (USBPRN.dll) will do that, when loaded by the OS/USB Stack.

    The error 55 translates to ERROR_DEV_NOT_EXIST. This means that the USB printer class driver has not been loaded by the OS.

    The USB Host (USBD.DLL) will load the appropriate drivers when a device gets attached.You're root problem is that the driver does not get loaded for some reason.

    The next thing you have to to is figure out why the usb printer class driver does not get loaded.

    As a starting point: Build a Debug configuration of your OS Design. Once the OS is running with Kernel Debugger attached (before connecting the printer), enable at least the Debug Zone "Loader" for the Module "USBD". You should see a bunch of debug messages that sould help you understand what's happening when you attach the printer to the device.

    This thread may be useful as well: http://social.msdn.microsoft.com/Forums/en/winembplatdev/thread/27be1f37-ae23-4797-96dd-a91452caeda2

    Michael


    MVP Windows Embedded
    Thursday, May 5, 2011 11:13 AM
  • Look for a registry editor for CE in the internet and execute it in your platform. Note that HKLM means HKEY_LOCAL_MACHINE. Usually the USB printer is named as LPT2. Also, check if the USB ports are OK by attaching a USB storage or USB mouse. At0s
    At0s
    Thursday, May 5, 2011 11:37 AM
  • Hi Michel,

     

    Thanks For your support.

    I removed manual entry of  "LPT1:" from [HKEY_LOCAL_MACHINE\Printers\Ports] key. Now whenever I connect printer using USB-OTG to our device it is loading USBPRN.dll, configuring USB as host and opening low level pipes for communication.

    Then we open wordpad in win CE and try give print command from file menu. At this time it is giving error as "Unable to print.Printer is not detected" and other observation is it is not loading pcl.dll.

    We tried to give print command from our customized application(this involves PCL functions to do print operations). In this case it is giving print command to printer.

    So to give print command from any application like wordpad on win ce do we need to do anything more?

    Below are the printer settings:

    [HKEY_LOCAL_MACHINE\Printers\Ports]
        "Port1"="COM1: 9600"
        "Port2"="COM7: 57600"
        "Port3"="NET0:"
       
    [HKEY_LOCAL_MACHINE\Printers\Settings]
        "TimeOut"=dword:1E
    [HKEY_LOCAL_MACHINE\PrintSettings]
        "TimeOut"=dword:2D
       
    [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default\Default\7\Printer_Class]
       "Prefix"="LPT"
       "Dll"="USBPRN.DLL"

    [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Printer_Class]
       "Prefix"="LPT"
       "Dll"="USBPRN.DLL"
      
    [HKEY_LOCAL_MACHINE\Printers]
       "DefaultPrinter"="PCL Laser"

     [HKEY_LOCAL_MACHINE\Printers\PCL Laser]
        "Driver"="pcl.DLL"
        "High Quality"="300"
        "Draft Quality"="150"
        "Color"="Monochrome"
        "Version"="0x200"

    Please suggest If I miss anything.

     

    Regards,

    Shiva

    Wednesday, May 11, 2011 10:57 AM
  • Hi, At last we are able to print wordpad document from USB-OTG and we are able to get print dialog box. The problem is in wordpad sorcecode.In this, print dialog box is having restriction on number of characters of printer entry name in registry. If printer name exceeds this limit print dialog box is throughing an exception. So we need to make sure the printer name entry in registry should not exceed this limit. At present I am able to print with 20 characters in printer entry name (Printers\Hewlett Pac). Thanks alot for all your support.
    • Proposed as answer by Shiva Manda Thursday, May 24, 2012 1:25 PM
    Friday, May 20, 2011 6:17 AM