473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

CClientDC

Hello!

The CClientDC class is derived from CDC and takes care of calling the
Windows functions GetDC at construction time and ReleaseDC at destruction
time. This means that the device context associated with a CClientDC object
is the client area of a window.

The rows above is from the documentation of CClientDC.

I just wonder what does the last line mean it says "This means that the
device context associated with a CClientDC object is the client area of a
window".

//Tony


Nov 17 '05 #1
1 1588
On Wed, 26 Oct 2005 17:21:12 GMT, "Tony Johansson"
<jo*****************@telia.com> wrote:
Hello!

The CClientDC class is derived from CDC and takes care of calling the
Windows functions GetDC at construction time and ReleaseDC at destruction
time. This means that the device context associated with a CClientDC object
is the client area of a window.

The rows above is from the documentation of CClientDC.

I just wonder what does the last line mean it says "This means that the
device context associated with a CClientDC object is the client area of a
window".


It means the surface area onto which you can paint with this DC is mapped
one-to-one onto the client area of the window you specified when you
created the DC. That said, normally you don't use CClientDC for painting,
which you do in response to WM_PAINT, which gives you a DC to paint on.
Instead, CClientDC is useful when you need to, say, calculate window size
based on font height or text width. With a CClientDC, you can select a font
into the DC, use GetTextMetrics or GetTextExtent or even
DrawText(DT_CALCRECT), and perform calculations based on the font the
window will use to draw text.

--
Doug Harrison
Visual C++ MVP
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tristan | last post by:
I'm developing a class which is to draw to a given graphics context i.e a CClientDC in Visual C++. The problem I have it is that my functions implement a specific interface which are platform...
1
by: Abd | last post by:
Hiiiiiii I am programming in Visual C++ 6.0 I want to get RGB percent of all of pixls of screen, and so I need to get Device Context of entire screen. I know that CClientDC dc(this) gets a divice...
2
by: Ben Taylor | last post by:
Hi, I am writing a program that uses different threads to handle various painting operations, I wondered if somebody could possible tell me if I create a new thread using...
2
by: Ben Taylor | last post by:
Hi, I am building an ActiveX control, which I would like NOT to be windowless (e.g. the common dialog control in Visual Basic being an example of one that is windowless, I don't want one like...
1
by: darrellm58 | last post by:
THis code is straight out of a text book but the color is always black. It is suppossed to draw black with one mouse button and red with the other. Can anyone spot a problem? Thanks. ************...
6
by: Phillip N Rounds | last post by:
I have an application which is heavily graphics intensive, all the graphics being custom. Scattered throughout by app, I have MyView->OnDraw( this->GetDC() ); Apparently, each call to ...
9
by: tomrmgc | last post by:
Here is the problem we've encountered. An application that used to successfully display Japanese Kanji characters no longer does so when recompiled with 7.1 When compiled with the 6.0 compiler,...
1
by: ShurikAg | last post by:
Hi, I have this kind of class: // SplashWnd.cpp : implementation of the CSplashWnd class // /////////////////////////////////////////////////////////////////////////////
6
by: InNeedOfHelp | last post by:
I am writing an application using MFC and was wanting to include a function similar to the select function available in Paint. I want to allow the user to grab the screen and drag it where they want...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.