install usb printer

  • Hi,


    I copied the files pcl.dll and usbprn.dll to the PicoMod in the \FFSDISK folder.
    Then I plugged in my USB-cable (from printer) and the popup window to enter the Device Name opened.
    I entered "usbprn" and pressed OK. But the popup window opened again.


    What is wrong on my installation?

  • Hello,
    - is your printer PCL compatible?
    - you may try to register by hand

    Code
    1. [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default\Default\7\Printer_Class]
    2. "DLL"="USBPRN.DLL"
    3. "Prefix"="LPT"
    4. [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Printer_Class]
    5. "DLL"="USBPRN.DLL"
    6. "Prefix"="LPT"


    - i will look for more recent usbprn and pcl DLLs and put them into the "printer thread" in the sample section.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • If I print to the received HDC, the printed text will be displayed on the display, not on the printer.


    I use the following code to create the HDC in c#


    Calling the methods StartPage failes with -1. GtLastError delivers 6, which means invalid handle.
    If I continue my printing, the text will be displayed on the disply and not on the printer.
    How can I verify, that the HDC is valid?

  • - Are the installation working now? If dialog is never closed i suggest there are some errors while installation so printing will not work! I will place prn-files tested under WCE6 on PicoMOD3 in the printer thread of the samples section.


    Quote

    How can I verify, that the HDC is valid?

    - Refer MSDN, CreateDC() have to return a value >=1. Did you interchange parameter 1 and 2 of CreateDC()?

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • With the latest dll I have the same problem.


    As you can see, I interchange the parameter you had in the example.

    Code
    1. CreateDC(null, PRINTER_DEV, PRINTER_PORT, yDevModeData)


    But why does StartPage fail?

  • Just for clearification:
    - does the installation work? If not did you try an other printer?
    - Your C# CreateDC wrapper function really interchange the parameters one and two? (original API -> CreateDC(PRINTER_DEV,NULL,PRINTER_PORT,&dm);). If not, this will cause an error.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I had to do the installation of the driver manually. I had to write all information into the registry.


    I have to wait for a other printer. At the moment that is the only one I have.


    As you can see, I use the CreateDC method as show in the code below. If the second parameter (Device) is null, the method call fails, which makes sense.
    CreateDC returns with the correct parameter a valid handle.
    This handle is used in the StartPage method call. The method fails with last error 6 (invalid handle).
    If I continue, the text which should be printed is shown on the display!!


  • Ok, now i think it is clear.
    The installtion is not ok. Wait for the new printer.


    You wrapper does not interchange the parameters! So if you pass zero to second parameter the LCD is addressed (according msdn online help)!

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Ok, this

    Quote

    So if you pass zero to second parameter the ...

    was my fault.


    But note printer is also a "display device". I already used "CreateDC(PRINTER_DEV, null, PRINTER_PORT, DevModeData);" without problems. If first parameter is zero you get always a screen DC.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • My new printer get registered now.
    In the registry I can see the following wntry:


    HLM
    Printers->ZTC LP2844-Z-200dpi
    string Driver "pcl.dll"
    ...


    CreateDC is successful but the next step fails.
    StartDoc return -1, and last error return 6 (Invalid handle)
    What could be the reason for that?


    I use c++ for my test, so I do not have any problems with invoking the API in C#:

  • Hello, thereby my code:

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Sorry but this is not possible, because this is a custom project with more then hundred files! And for isolation will cost a lot of time.
    But i think this is also not needed becauce the relevant structure for pinting is shown:
    - Create printer DC
    - Selcet GDI objects (font, ...) into the DC
    - Start printing into the DC
    - PrintActParamSet(), ... are only a functions which draw into the printer DC
    - End printing

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,


    usbprn should be part of OS (try cmd command "attrib u*.dll"). Pcl.dll is available here How to install an USB printer on NetDCUX and PicoMODX. You may replace pcl.dll by a driver from your printer manufactor.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • OK, Thank you.
    Do you have in the meantime a driver for a higher PCL-level?
    Do you also provide drivers for further printer languages, e.g. GDI, PS, SPL?
    Do you have a list of tested or compatible printers?