🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TPrinter Problem

#15109
From: JD
Date: Wed, 16 Jul 2003 00:31
24 lines
1842 bytes
"Anthony" <awhitesell@attbi.com> wrote:
> [...] so the operator can choose the printer or a way to get
> from Printers()->Printers->Strings[] to the Device name so I
> can call OpenPrinter(Device, &HPrinter, NULL) reliably.

// Assign the list of printers for the user
prnComboBox->Items->Assign( Printer()->Printers );
// Set the ComboBox to point to the default printer
Printer()->PrinterIndex = -1;
prnComboBox->ItemIndex  = Printer()->PrinterIndex;
// save the default printer
int SavePrinter = Printer()->PrinterIndex;
// get device info to call OpenPrinter
char Device[ 256 ] = { 0 };
char Driver[ 256 ] = { 0 };
char Port[ 256 ] = { 0 };
THandle hDeviceMode;
Printer()->PrinterIndex = prnComboBox->ItemIndex;
Printer()->GetPrinter( Device, Driver, Port, hDeviceMode );
// call open printer
OpenPrinter( Device, &hDeviceMode, NULL);

~ JD
Technical Details
Message-ID: <3f149cc9$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com> <qgq8hv4fn52ds00n5hv0602s8hfm6lksbv@4ax.com> <3f149911$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,d59131589fe63384
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-15 17:39:54 PST
From: "JD" <nospam@nospam.com>
Sender: "JD" <nospam@nospam.com>
Reply-To: "JD" <nospam@nospam.com>
Subject: Re: TPrinter Problem
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 172.201.9.240 172.201.9.240    
References: <3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com> <qgq8hv4fn52ds00n5hv0602s8hfm6lksbv@4ax.com> <3f149911$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3f149cc9$1@newsgroups.borland.com>
Date: 15 Jul 2003 17:31:05 -0700
X-Trace: newsgroups.borland.com 1058315465 207.105.83.65 (15 Jul 2003 17:31:05 -0700)
Lines: 25
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail