🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Windows Printers

#12525
From: Bob Gonder
Date: Mon, 01 Dec 2003 17:49
33 lines
2376 bytes
John Scott wrote:

>I am testing by sending the PCL code to rotate text 90deg. Nothing is
>printed.
>The code I am using is:
>
>    // Nov 2003 to print double sided
>    char ADevice[256]={0}, ADriver[256]={0}, APort[256]={0};
>    THandle  ADeviceMode;
>    Printer()->GetPrinter(ADevice, ADriver, APort, ADeviceMode);
>    Printer()->SetPrinter(ADevice, ADriver, APort, ADeviceMode);
>    // end of add Nov 2003

Just curious, but why don't you use the settings in the DEVMODE
structure to select orientation and duplex? (This is non-vcl )

OpenPrinter(&printer_name,&printerHandle,NULL);
num_bytes = DocumentProperties(NULL, printerHandle, &printer_name,
				NULL, NULL, 0);
DevMode = (DEVMODE*)GlobalAlloc( GMEM_FIXED|GMEM_ZEROINIT,num_bytes);
DocumentProperties(NULL, printerHandle, &printer_name, DevMode,
				NULL, DM_OUT_BUFFER);

DevMode.dmOrientation = DMORIENT_LANDSCAPE;
DevMode.dmDuplex = DMDUP_VERTICAL;
DevMode.dmFields = DM_ORIENTATION | DM_DUPLEX;

DocumentProperties(NULL, printerHandle, &printer_name, DevMode,
		DevMode, DM_OUT_BUFFER | DM_IN_BUFFER);

	// create a printer device context
printerDC = CreateDC( NULL, &printer_name, NULL, DevMode); 
GlobalFree(DevMode);
Technical Details
Message-ID: <goumsvolftvangoh1n8i7ktptavi57ut2d@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fbcf9c2@newsgroups.borland.com> <3fbd8132$1@newsgroups.borland.com> <3fc77301@newsgroups.borland.com> <3fc7e524$1@newsgroups.borland.com> <3fca2474@newsgroups.borland.com> <3fcb2567$1@newsgroups.borland.com> <3fcb6984@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,7b2449597708bec
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-12-01 10:09:38 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Windows Printers
Date: Mon, 01 Dec 2003 09:49:59 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <goumsvolftvangoh1n8i7ktptavi57ut2d@4ax.com>
References: <3fbcf9c2@newsgroups.borland.com> <3fbd8132$1@newsgroups.borland.com> <3fc77301@newsgroups.borland.com> <3fc7e524$1@newsgroups.borland.com> <3fca2474@newsgroups.borland.com> <3fcb2567$1@newsgroups.borland.com> <3fcb6984@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.164.100
X-Trace: newsgroups.borland.com 1070301000 67.31.164.100 (1 Dec 2003 09:50:00 -0700)
Lines: 37
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail