Results 1 to 3 of 3

Thread: How to use OpenPrinter function in qt

  1. #1
    Join Date
    Jul 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question How to use OpenPrinter function in qt

    Hi
    i wish to use openprinter method and print raw data . i have given the codes which i used below.but some error comes;
    error:
    undefined reference to `OpenPrinterW@12'

    I included

    #include "windows.h"
    #include "winspool.h".

    LIB+=-lwinspool also added in .pro file.but error comes

    coding:
    LPTSTR pPrinterName;
    HANDLE hPrinter;
    PRINTER_DEFAULTSW DefaultW, *pDefaultW = NULL;

    OpenPrinterW(pPrinterName, &hPrinter, NULL);

    Please help.Thanks in advance

  2. #2
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: How to use OpenPrinter function in qt

    Modify
    Qt Code:
    1. LIB+=-lwinspool
    To copy to clipboard, switch view to plain text mode 

    to
    Qt Code:
    1. LIBS += -lwinspool
    To copy to clipboard, switch view to plain text mode 

    You forget the 'S'.

  3. #3
    Join Date
    Jul 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to use OpenPrinter function in qt

    Thanks.now no error.qt build finished

Similar Threads

  1. Replies: 3
    Last Post: 25th May 2010, 09:46
  2. Windows OpenPrinter problem
    By dougbroadwell in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2010, 18:23
  3. Replies: 0
    Last Post: 10th March 2010, 08:13
  4. Zip function for Qt4
    By devilj in forum Newbie
    Replies: 7
    Last Post: 15th July 2007, 14:37
  5. Square function
    By ^NyAw^ in forum Qt Programming
    Replies: 5
    Last Post: 12th February 2007, 17:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.