🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16962

Re: printer driver for "Text Only" printer

#16962
From: Christian
Date: Thu, 17 Apr 2003 09:36
35 lines
2537 bytes
Hi,

I have used EnumPrinters() to get the values for the "Generic - Text Only"
printer, then used them to create my own PRINTER_INFO_2 structure and it
WORKS!! :-)

The PRINTER_INFO_2 structure must be this:

PrinterInfo->pServerName       = NULL;
PrinterInfo->pPrinterName      = "Generic";
PrinterInfo->pShareName        = NULL;
PrinterInfo->pPortName         = "FILE:";
PrinterInfo->pDriverName       = "Generic / Text Only";
PrinterInfo->pComment          = NULL;
PrinterInfo->pLocation         = NULL;
PrinterInfo->pDevMode          = NULL;
PrinterInfo->pSepFile          = NULL;
PrinterInfo->pPrintProcessor   = "WinPrint";
PrinterInfo->pDatatype         = "RAW";
PrinterInfo->pParameters       = NULL;
PrinterInfo->pSecurityDescriptor = NULL;
PrinterInfo->Attributes        = 576;
PrinterInfo->Priority          = 1;
PrinterInfo->DefaultPriority   = 0;
PrinterInfo->StartTime         = 0;
PrinterInfo->UntilTime         = 0;
PrinterInfo->Status            = 0;
PrinterInfo->cJobs             = 0;
PrinterInfo->AveragePPM        = 0;

Give this structure to AddPrinter() and you get a fileprinter called
"Generic" that is not the default printer and is not shared.
Thanks again Gary for your simple but great idea :-)

Christian
Technical Details
Message-ID: <3e9e7589@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!out.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3e95497f@newsgroups.borland.com> <3e957801@newsgroups.borland.com> <3e9abc7c@newsgroups.borland.com> <3e9c0cb1$1@newsgroups.borland.com> <3e9ca14b$1@newsgroups.borland.com> <3e9d37d8@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f2214e094c069c58
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-17 02:50:33 PST
From: "Christian" <scholle3783@icqmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e95497f@newsgroups.borland.com> <3e957801@newsgroups.borland.com> <3e9abc7c@newsgroups.borland.com> <3e9c0cb1$1@newsgroups.borland.com> <3e9ca14b$1@newsgroups.borland.com> <3e9d37d8@newsgroups.borland.com>
Subject: Re: printer driver for "Text Only" printer
Date: Thu, 17 Apr 2003 11:36:06 +0200
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 217.225.250.119
Message-ID: <3e9e7589@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1050572169 217.225.250.119 (17 Apr 2003 02:36:09 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!out.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail