Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to capture "Enter Key"? Pin
Code-o-mat1-Apr-09 23:33
Code-o-mat1-Apr-09 23:33 
GeneralRe: How to capture "Enter Key"? Pin
gothic_coder1-Apr-09 23:59
gothic_coder1-Apr-09 23:59 
GeneralRe: How to capture "Enter Key"? Pin
Code-o-mat2-Apr-09 0:20
Code-o-mat2-Apr-09 0:20 
GeneralRe: How to capture "Enter Key"? Pin
gothic_coder2-Apr-09 1:31
gothic_coder2-Apr-09 1:31 
GeneralRe: How to capture "Enter Key"? Pin
Code-o-mat2-Apr-09 1:34
Code-o-mat2-Apr-09 1:34 
QuestionCMainwindow Pin
p_19601-Apr-09 20:20
p_19601-Apr-09 20:20 
AnswerRe: CMainwindow Pin
Stuart Dootson1-Apr-09 22:01
professionalStuart Dootson1-Apr-09 22:01 
AnswerRe: CMainwindow Pin
Iain Clarke, Warrior Programmer2-Apr-09 6:24
Iain Clarke, Warrior Programmer2-Apr-09 6:24 
p_1960 wrote:
Please can u explain the concept of the above lines in detail....


Nope, Got better things to do! (Sun is shining...)

But you are right to be slightly concerned.

The brush returned from SelectObject should have been selected back in. You'd almost certainly get away with the code as it is, but "get away with" is hardly good programming.

Better:
void CMainWindow::OnPaint ()
{
   CPaintDC dc (this);
   CBrush brush (RGB (255, 0, 0));
   CBrush *brOld = dc.SelectObject (&brush);
   dc.Ellipse (0, 0, 200, 100);
   dc.SelectObject (brOld);
}


Iain.

In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!

QuestionHow to retrieve contents of a control in a different application? Pin
neil47811-Apr-09 19:51
neil47811-Apr-09 19:51 
AnswerRe: How to retrieve contents of a control in a different application? Pin
Stuart Dootson1-Apr-09 22:09
professionalStuart Dootson1-Apr-09 22:09 
AnswerRe: How to retrieve contents of a control in a different application? Pin
sashoalm4-Apr-09 3:32
sashoalm4-Apr-09 3:32 
QuestionAnother Stupid Question? Pin
Joseph Marzbani1-Apr-09 19:35
Joseph Marzbani1-Apr-09 19:35 
AnswerRe: Another Stupid Question? Pin
«_Superman_»1-Apr-09 19:45
professional«_Superman_»1-Apr-09 19:45 
AnswerRe: Another Stupid Question? Pin
Joseph Marzbani1-Apr-09 20:12
Joseph Marzbani1-Apr-09 20:12 
JokeRe: Another Stupid Question? Pin
Iain Clarke, Warrior Programmer2-Apr-09 6:15
Iain Clarke, Warrior Programmer2-Apr-09 6:15 
AnswerRe: Another Stupid Question? Pin
Maxwell Chen1-Apr-09 20:24
Maxwell Chen1-Apr-09 20:24 
GeneralRe: Another Stupid Question? Pin
vital_parsley1-Apr-09 21:46
vital_parsley1-Apr-09 21:46 
AnswerRe: Another Stupid Question? Pin
Joseph Marzbani1-Apr-09 22:53
Joseph Marzbani1-Apr-09 22:53 
QuestionWindows Message API problem for LVM_GETITEMTEXT Pin
Joshi, Rushikesh1-Apr-09 19:30
professionalJoshi, Rushikesh1-Apr-09 19:30 
AnswerRe: Windows Message API problem for LVM_GETITEMTEXT Pin
«_Superman_»1-Apr-09 19:49
professional«_Superman_»1-Apr-09 19:49 
GeneralRe: Windows Message API problem for LVM_GETITEMTEXT Pin
Joshi, Rushikesh1-Apr-09 23:44
professionalJoshi, Rushikesh1-Apr-09 23:44 
Questionhow to transfer file between windows and linux Pin
chen10001-Apr-09 18:58
chen10001-Apr-09 18:58 
AnswerRe: how to transfer file between windows and linux Pin
Stuart Dootson1-Apr-09 22:23
professionalStuart Dootson1-Apr-09 22:23 
Questionscaler deleting destructor Pin
Deepu Antony1-Apr-09 18:34
Deepu Antony1-Apr-09 18:34 
AnswerRe: scaler deleting destructor Pin
Maxwell Chen1-Apr-09 19:23
Maxwell Chen1-Apr-09 19:23 

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.