help in setPrinterdata function.

  • Thread starter Thread starter hari
  • Start date Start date
H

hari

Hi all,

I m calling setprinterdata API in my printer driver ,It is called
in a While(1) (infinite loop),When I restart my Personal computer,the
driver vanishes in the printer and faxes folder.


Code is

While(1)
{

hPrinter = Openprinter(L"Pname"...................);

DWORD dwErr = SetPrinterData(hPrinter, L"Printer_Status", REG_BINARY ,
(LPBYTE)szID1, 6);
ClosePrinter(hPrinter);

}

Thanks in Advance.
please help me in this issue.

Regards
Hari
 
Hi all,

I m calling setprinterdata API in my printer driver ,It is called
in a While(1) (infinite loop),When I restart my Personal computer,the
driver vanishes in the printer and faxes folder.

Code is

While(1)
{

hPrinter = Openprinter(L"Pname"...................);

DWORD dwErr = SetPrinterData(hPrinter, L"Printer_Status", REG_BINARY ,
(LPBYTE)szID1, 6);
ClosePrinter(hPrinter);

}

Thanks in Advance.
please help me in this issue.

Regards
Hari


Hi,

You can use the following API to install a local or remote
printer driver, and link the configuration, data, and driver
files as well. The function SetPrinterData() sets the
configuration data for a printer or print server:

AddPrinterDriverEx()

http://msdn2.microsoft.com/en-us/library/ms535645.aspx

http://msdn2.microsoft.com/en-us/library/ms535657.aspx

Kellie.
 
Back
Top