Click here to Skip to main content
15,929,978 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: nothing appear! Pin
Mazdak22-Feb-02 23:27
Mazdak22-Feb-02 23:27 
GeneralRe: nothing appear! Pin
Steen Krogsgaard22-Feb-02 23:22
Steen Krogsgaard22-Feb-02 23:22 
GeneralRe: nothing appear! Pin
Mazdak22-Feb-02 23:25
Mazdak22-Feb-02 23:25 
GeneralRe: nothing appear! Pin
Mazdak23-Feb-02 0:02
Mazdak23-Feb-02 0:02 
GeneralRe: nothing appear! Pin
Tim Deveaux23-Feb-02 4:39
Tim Deveaux23-Feb-02 4:39 
GeneralRe: nothing appear! Pin
Steen Krogsgaard24-Feb-02 0:54
Steen Krogsgaard24-Feb-02 0:54 
GeneralRe: nothing appear! Pin
Steen Krogsgaard24-Feb-02 0:56
Steen Krogsgaard24-Feb-02 0:56 
GeneralRe: nothing appear! Pin
Paul M Watt23-Feb-02 10:34
mentorPaul M Watt23-Feb-02 10:34 
The reason why this code will work instead is that in the constructor for CPaintDC, there is a call to BeginPaint in order to initialize the internal HDC. When begin paint is called, it sets something that is called the System region of the HDC.

For all intents and purposes, the System region is like a clipping region that cannot be changed. When you paint on a DC, the intersection of the system region, the clipping region, and the meta region are combined in order to give the developer the final region that is painted.

When a call to GetDC is made, the system region is set to the client area of the window.
When GetWindowDC is called, the system region is set to the window rect of the window.
When BeginPaint is called, the system region is set to the current invalid region of the window, then the invalid region is validated.

So, if you make two calls to BeginPaint, you will receive two successfully created DC's, however, the first one will contain a system region that has the invalid region set into it, and the second one will contain an empty second region. Therefore if you try to paint on the first region in one color, say blue, then it will succceed. Then if you try to paint on the second region in red, none of the operations would succeed because there is an empty second region.
QuestionHow to load icon resource into hBitmap ? Pin
22-Feb-02 22:53
suss22-Feb-02 22:53 
AnswerRe: How to load icon resource into hBitmap ? Pin
Joaquín M López Muñoz22-Feb-02 23:15
Joaquín M López Muñoz22-Feb-02 23:15 
GeneralRe: How to load icon resource into hBitmap ? Pin
23-Feb-02 3:18
suss23-Feb-02 3:18 
QuestionHow to get the export table of a given module Pin
22-Feb-02 22:52
suss22-Feb-02 22:52 
AnswerRe: How to get the export table of a given module Pin
Paul M Watt23-Feb-02 6:58
mentorPaul M Watt23-Feb-02 6:58 
GeneralGlobal variable in MFC Pin
22-Feb-02 21:52
suss22-Feb-02 21:52 
GeneralRe: Global variable in MFC Pin
Paul M Watt22-Feb-02 22:06
mentorPaul M Watt22-Feb-02 22:06 
GeneralRe: Global variable in MFC Pin
Nish Nishant22-Feb-02 22:22
sitebuilderNish Nishant22-Feb-02 22:22 
GeneralRe: Global variable in MFC Pin
23-Feb-02 0:10
suss23-Feb-02 0:10 
GeneralOnPaint Handling... Pin
John Cruz22-Feb-02 18:30
John Cruz22-Feb-02 18:30 
GeneralRe: OnPaint Handling... Pin
Paul M Watt22-Feb-02 22:15
mentorPaul M Watt22-Feb-02 22:15 
GeneralRe: OnPaint Handling... Pin
John Cruz23-Feb-02 2:39
John Cruz23-Feb-02 2:39 
GeneralVC6 Macros: Object model shortcomings & bugs Pin
rseidl22-Feb-02 18:01
rseidl22-Feb-02 18:01 
GeneralRe: VC6 Macros: Object model shortcomings & bugs Pin
rseidl24-Feb-02 21:05
rseidl24-Feb-02 21:05 
GeneralReplacing one CFormView derived view with another Pin
Aaron Schaefer22-Feb-02 17:20
Aaron Schaefer22-Feb-02 17:20 
GeneralRe: Replacing one CFormView derived view with another Pin
Mazdak22-Feb-02 22:01
Mazdak22-Feb-02 22:01 
GeneralSelectObject(HBITMAP) problem. Pin
22-Feb-02 16:49
suss22-Feb-02 16:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.