PDA

View Full Version : How to use OpenPrinter function in qt



Prabha
31st July 2010, 06:57
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

saa7_go
31st July 2010, 08:10
Modify

LIB+=-lwinspool

to


LIBS += -lwinspool


You forget the 'S'.

Prabha
31st July 2010, 09:36
Thanks.now no error.qt build finished