Click here to Skip to main content
15,914,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Multiple CDC::SelectObject() Pin
PatrykDabrowski20-Mar-07 2:39
PatrykDabrowski20-Mar-07 2:39 
JokeRe: Multiple CDC::SelectObject() Pin
CPallini20-Mar-07 2:45
mveCPallini20-Mar-07 2:45 
GeneralRe: Multiple CDC::SelectObject() Pin
toxcct20-Mar-07 3:14
toxcct20-Mar-07 3:14 
GeneralRe: Multiple CDC::SelectObject() Pin
PatrykDabrowski20-Mar-07 3:19
PatrykDabrowski20-Mar-07 3:19 
GeneralRe: Multiple CDC::SelectObject() Pin
toxcct20-Mar-07 3:25
toxcct20-Mar-07 3:25 
GeneralRe: Multiple CDC::SelectObject() Pin
PatrykDabrowski20-Mar-07 3:47
PatrykDabrowski20-Mar-07 3:47 
GeneralRe: Multiple CDC::SelectObject() Pin
toxcct20-Mar-07 3:51
toxcct20-Mar-07 3:51 
AnswerRe: Multiple CDC::SelectObject() Pin
Parthi_Appu20-Mar-07 2:49
Parthi_Appu20-Mar-07 2:49 
PatrykDabrowski wrote:
I delete some_bitmapX objects (when exiting the app as they are 'global').


If you are creating those object once and deleting at the end, then no problem.
PatrykDabrowski wrote:
CreateCompatibleDC()/DeleteDC() slower comparing to CDC::SaveDC()/RestoreDC()??

These two set of APIs are different from each other.
That is, after creating a compatible DC, you have select the needed objects into the DC. At last the original object belong to the DC have to be selected (the object returned, at the first select object, note this appicable for that specific type of object).
DelectDC will delete the DC that you created.

But the SaveDC and RestoreDC is for making the DC to its original state, you need not worry about reselecting the original objects. see below;
CDC dc; dc.CreateCompatibleDC(..);
dc.SaveDC();
dc.SelectObject(bitmap1); /* do something */
dc.SelectObject(bitmap2); /* do something */
dc.RestoreDC( -1 );
dc.DeleteDC();

By doing so, you need not have to maintain the old objects returned.



Do your Duty and Don't expect the Result

QuestionMicrosoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 1:06
Programm3r20-Mar-07 1:06 
AnswerRe: Microsoft Visual C++ Runtime Library Error Pin
toxcct20-Mar-07 1:13
toxcct20-Mar-07 1:13 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 1:30
Programm3r20-Mar-07 1:30 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
toxcct20-Mar-07 1:39
toxcct20-Mar-07 1:39 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 1:44
Programm3r20-Mar-07 1:44 
QuestionRe: Microsoft Visual C++ Runtime Library Error Pin
prasad_som20-Mar-07 1:22
prasad_som20-Mar-07 1:22 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 1:35
Programm3r20-Mar-07 1:35 
QuestionRe: Microsoft Visual C++ Runtime Library Error Pin
prasad_som20-Mar-07 1:46
prasad_som20-Mar-07 1:46 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 1:57
Programm3r20-Mar-07 1:57 
AnswerRe: Microsoft Visual C++ Runtime Library Error Pin
prasad_som20-Mar-07 2:12
prasad_som20-Mar-07 2:12 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 2:24
Programm3r20-Mar-07 2:24 
QuestionRe: Microsoft Visual C++ Runtime Library Error Pin
prasad_som20-Mar-07 2:27
prasad_som20-Mar-07 2:27 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 2:42
Programm3r20-Mar-07 2:42 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
prasad_som20-Mar-07 2:49
prasad_som20-Mar-07 2:49 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 2:59
Programm3r20-Mar-07 2:59 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
toxcct20-Mar-07 3:08
toxcct20-Mar-07 3:08 
GeneralRe: Microsoft Visual C++ Runtime Library Error Pin
Programm3r20-Mar-07 3:18
Programm3r20-Mar-07 3:18 

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.