Difference between Cclint DC & Cpaint Dc

Answers were Sorted based on User's Feedback



Difference between Cclint DC & Cpaint Dc..

Answer / s.subashselvan

CClientDC will paint only the client area of the window and
it will work any message handler.
CPaintDC will paint only the client area of the window but
it only work on OnPaint message Handler only.

Is This Answer Correct ?    26 Yes 2 No

Difference between Cclint DC & Cpaint Dc..

Answer / susinderan

Both draws only window's client Area
-----------------
CClienDC()
-----------------
(i) constructor calls GetDc()
(ii) Destructor calls Release()
(iii) Will not remove WM_PAINT msg
(iv) Should not be used inside onPaint().
can be used outside onPaint()

-----------------
CPaintDC()
-----------------
(i) constructor calls BeginPaint()
(ii) Destructor calls EndPaint()
(iii) Will remove WM_PAINT msg
(iv) Should be used only inside onPaint()

Is This Answer Correct ?    5 Yes 0 No

Difference between Cclint DC & Cpaint Dc..

Answer / narendra

CPaintDC For drawing in a window's client area (OnPaint
handlers only)
CClientDC For drawing in a window's client area (anywhere
but OnPaint)

Is This Answer Correct ?    7 Yes 3 No

Difference between Cclint DC & Cpaint Dc..

Answer / swati

Cpaintdc can be used for only onpaint handler while
cclientdc can be used to paint in client area bt can use any
handlers like ondraw,onpaint
cwindow can be used to paint in whole window
cmetafile is used to store seq of files as physical output.

Is This Answer Correct ?    3 Yes 0 No

Difference between Cclint DC & Cpaint Dc..

Answer / rahul susar

"CPaintDC" For drawing in a window's client area (OnPaint
handlers only)
"CClientDC" For drawing in a window's client area (anywhere
but OnPaint)
"CWindowDC" For drawing anywhere in a window, including the
nonclient area
"CMetaFileDC" For drawing to a GDI metafile

Is This Answer Correct ?    0 Yes 3 No

Difference between Cclint DC & Cpaint Dc..

Answer / pnnr

CClientDC will paint only the client area of the window
CPaintDC will paint the whole window area including the
client area and non client area (Menu's , toolbar's etc..)

Is This Answer Correct ?    9 Yes 17 No

Post New Answer

More MFC Interview Questions

Will there be any difference in the image buffer size if it is loaded in from CString to LPTSTR using GetBuffer()? lptstr = string.GetBuffer(0);

2 Answers  


How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)When it gets called? c)how it comes to message queue? Please Explain it

8 Answers  


how do u identify RTTI in vc++

4 Answers   Siemens,


What interface must be supported by an ActiveX control?

2 Answers  


what is the difference between SDI and MDI

15 Answers   CMC, HCL, Siemens,






how many types of classes are ther,what are that

7 Answers   L&T,


How to handle RTTI in MFC ?

1 Answers  


How can we create thread in MFC framework?

3 Answers  


How to convert the content of buffer into lower case character.

3 Answers   E Logic,


Difference between Cclint DC & Cpaint Dc

6 Answers   E Logic,


Whats is DDX & DDV in MFC?

1 Answers   HCL,


what is the use of Mutex and critical section

2 Answers  


Categories