🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: printer driver for "Text Only" printer

#17021
From: Christian
Date: Mon, 14 Apr 2003 13:49
50 lines
2465 bytes
Thanks Gary, but this is not what I need. I have to install the "Generic -
Text Only" printer, because of a component I use in my app. If no printer is
present the component goes mad ;-)

Christian

"Gary Setter" <setterg@worldnet.att.net> schrieb im Newsbeitrag
news:3e957801@newsgroups.borland.com...
>
> "Christian" <scholle3783@icqmail.com> wrote in message
> news:3e95497f@newsgroups.borland.com...
> > Hello, when I use AddPrinter() to install the "Generic - Text Only"
> printer,
> > I get the error, that the printer driver is unknown. Can anybody tell me
> the
> > name of the correct printer driver for the PRINTER_INFO_2 structure?
> >
> > Thanks
> > Christian
> >
>
> If you just want the default printer, might this help?
>
> static const char * GetDriverName(DEVNAMES *DevNames)
> {
>   return DevNames ? (char far*)DevNames + DevNames->wDriverOffset : 0;
> }
> /*
>  Get the device name from a DEVNAMES object.
> */
> static const char * GetDeviceName(DEVNAMES *DevNames)
> {
>   return DevNames ? (char far*)DevNames + DevNames->wDeviceOffset : 0;
> }
>
> DisplayDefaultPrinter(HWND hWnd)
> {
>  PRINTDLG info;
>  memset(&info,0,sizeof(info));
>  info.lStructSize = sizeof(info);
>  info.hwndOwner = hWnd;
>  info.Flags = PD_RETURNDEFAULT;
>  PrintDlg(&info);
>    if (info.hDevNames) {
>      DEVNAMES * names = (DEVNAMES *)GlobalLock(info.hDevNames);
>      if (names)
>      MessageBox(hWnd,GetDriverName(names),GetDeviceName(names),MB_OK);
>    }
> }
>
Technical Details
Message-ID: <3e9abc7c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e95497f@newsgroups.borland.com> <3e957801@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-14 06:56:03 PST
From: "Christian" <scholle3783@icqmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e95497f@newsgroups.borland.com> <3e957801@newsgroups.borland.com>
Subject: Re: printer driver for "Text Only" printer
Date: Mon, 14 Apr 2003 15:49:44 +0200
Lines: 52
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.248.121
Message-ID: <3e9abc7c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1050328188 217.225.248.121 (14 Apr 2003 06:49:48 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail