🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Windows Printers

#12455
From: Bob Gonder
Date: Thu, 04 Dec 2003 16:01
21 lines
2254 bytes
John Scott wrote:

>
>DeviceMode returns the handle to a memory buffer containing a DEVMODE
>structure, which contains device-specific initialization data for the device
>driver. Use the GlobalLock function to convert this handle into a pointer to
>the structure.
>
>I Guess I need to explore that GlobalLock function. I want to stick with the
>VCL as much as possible since the existing code is VCL.

Yes, essentially what it is doing is a variation on what I posted...
Instead of this
>> DevMode = (DEVMODE*)GlobalAlloc( GMEM_FIXED |GMEM_ZEROINIT,num_bytes);
it's doing this
>> ADevMode = (DEVMODE*)GlobalAlloc( GMEM_MOVEABLE ,num_bytes);

You then need to go through the extra step
DEVMODE*DevMode = (DEVMODE*)GlobalLock(ADevMode);
Then you can use the DevMode->dmFields code
Don't forget to GlobalUnlock(ADevMode) when you are done.
Technical Details
Message-ID: <l1musvshsvjifjg83ufbhqd50rl72go3jv@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fc77301@newsgroups.borland.com> <3fc7e524$1@newsgroups.borland.com> <3fca2474@newsgroups.borland.com> <3fcb2567$1@newsgroups.borland.com> <3fcb6984@newsgroups.borland.com> <goumsvolftvangoh1n8i7ktptavi57ut2d@4ax.com> <dsvmsvo53afn3qqk6p2ir6ld5lldimucju@4ax.com> <3fcb93d8@newsgroups.borland.com> <eipnsvs99q92prau97tl685lua6crv6e92@4ax.com> <3fce1fed@newsgroups.borland.com> <eudssvci6j3q0l82ivvfs5oj3i2rn1c5ct@4ax.com> <3fcf5268$1@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-04 08:10:06 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Windows Printers
Date: Thu, 04 Dec 2003 08:01:38 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <l1musvshsvjifjg83ufbhqd50rl72go3jv@4ax.com>
References: <3fc77301@newsgroups.borland.com> <3fc7e524$1@newsgroups.borland.com> <3fca2474@newsgroups.borland.com> <3fcb2567$1@newsgroups.borland.com> <3fcb6984@newsgroups.borland.com> <goumsvolftvangoh1n8i7ktptavi57ut2d@4ax.com> <dsvmsvo53afn3qqk6p2ir6ld5lldimucju@4ax.com> <3fcb93d8@newsgroups.borland.com> <eipnsvs99q92prau97tl685lua6crv6e92@4ax.com> <3fce1fed@newsgroups.borland.com> <eudssvci6j3q0l82ivvfs5oj3i2rn1c5ct@4ax.com> <3fcf5268$1@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.165.64
X-Trace: newsgroups.borland.com 1070553705 67.31.165.64 (4 Dec 2003 08:01:45 -0700)
Lines: 23
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail