🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: device context

#13308
From: Remy Lebeau (TeamB)
Date: Mon, 20 Oct 2003 09:17
18 lines
1664 bytes
"Alain R." <no.valid@email.com> wrote in message
news:3f937e3b@newsgroups.borland.com...

> How can i retrieve DC of the current component ? I tried
> GetDC(componentHandle) but it doesn't work too :(

GetDC() expects an HWND (window handle).  If the component has such a
handle, such as via a Handle property, then you should be passing that
Handle, not the actual component pointer, to GetDC().  Alternatively, if
your component is a TControl descendant (as it would have to be in order to
do visual work to begin with), then you can use the inherited
TControl::GetDeviceContext() method, which returns the HDC for the
component.  Or you can use a TControlCanvas, which has a Handle property for
obtaining an HDC, and uses TControl::GetDeviceContext() internally.


Gambit
Technical Details
Message-ID: <3f93a79c$2@newsgroups.borland.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: <3f937e3b@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2938bb3c4c23629c
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-20 02:39:44 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f937e3b@newsgroups.borland.com>
Subject: Re: device context
Date: Mon, 20 Oct 2003 02:17:33 -0700
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.137.75
Message-ID: <3f93a79c$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1066641308 67.22.137.75 (20 Oct 2003 02:15:08 -0700)
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