Click here to Skip to main content
15,904,156 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionOverflow in LPtoDP function Pin
ashtwin18-Oct-10 18:31
ashtwin18-Oct-10 18:31 
AnswerRe: Overflow in LPtoDP function Pin
Richard MacCutchan18-Oct-10 22:35
mveRichard MacCutchan18-Oct-10 22:35 
GeneralRe: Overflow in LPtoDP function Pin
ashtwin19-Oct-10 3:11
ashtwin19-Oct-10 3:11 
GeneralRe: Overflow in LPtoDP function Pin
Richard MacCutchan19-Oct-10 4:30
mveRichard MacCutchan19-Oct-10 4:30 
GeneralRe: Overflow in LPtoDP function Pin
ashtwin21-Oct-10 23:09
ashtwin21-Oct-10 23:09 
GeneralRe: Overflow in LPtoDP function Pin
Richard MacCutchan22-Oct-10 2:44
mveRichard MacCutchan22-Oct-10 2:44 
Questionstatic text box new line problem Pin
raju_shiva18-Oct-10 18:04
raju_shiva18-Oct-10 18:04 
AnswerRe: static text box new line problem Pin
vasu_sri18-Oct-10 19:01
vasu_sri18-Oct-10 19:01 
QuestionHow to use " CMFCPropertyGridProperty "to have a button Pin
stevenyes18-Oct-10 5:42
stevenyes18-Oct-10 5:42 
AnswerRe: How to use " CMFCPropertyGridProperty "to have a button Pin
Andrew Truckle28-Feb-24 7:58
professionalAndrew Truckle28-Feb-24 7:58 
QuestionOn the Origin of CTabCtrlEx used in Tabbed Dialogs Pin
federico.strati18-Oct-10 4:00
federico.strati18-Oct-10 4:00 
AnswerRe: On the Origin of CTabCtrlEx used in Tabbed Dialogs Pin
Electron Shepherd18-Oct-10 6:16
Electron Shepherd18-Oct-10 6:16 
QuestionHow can get Domain name in given URL? Pin
Le@rner18-Oct-10 2:44
Le@rner18-Oct-10 2:44 
AnswerRe: How can get Domain name in given URL? Pin
Chris Losinger18-Oct-10 3:00
professionalChris Losinger18-Oct-10 3:00 
AnswerRe: How can get Domain name in given URL? Pin
Code-o-mat18-Oct-10 8:58
Code-o-mat18-Oct-10 8:58 
Questionfitnesse about C++ Pin
lxlenovostar18-Oct-10 2:12
lxlenovostar18-Oct-10 2:12 
AnswerRe: fitnesse about C++ Pin
Maximilien18-Oct-10 3:42
Maximilien18-Oct-10 3:42 
GeneralRe: fitnesse about C++ Pin
lxlenovostar18-Oct-10 3:59
lxlenovostar18-Oct-10 3:59 
GeneralRe: fitnesse about C++ Pin
Richard MacCutchan18-Oct-10 9:31
mveRichard MacCutchan18-Oct-10 9:31 
GeneralRe: fitnesse about C++ Pin
lxlenovostar18-Oct-10 15:57
lxlenovostar18-Oct-10 15:57 
GeneralRe: fitnesse about C++ Pin
Aescleal18-Oct-10 21:39
Aescleal18-Oct-10 21:39 
GeneralRe: fitnesse about C++ Pin
lxlenovostar18-Oct-10 23:12
lxlenovostar18-Oct-10 23:12 
GeneralRe: fitnesse about C++ Pin
lxlenovostar19-Oct-10 20:43
lxlenovostar19-Oct-10 20:43 
GeneralRe: fitnesse about C++ Pin
Aescleal20-Oct-10 7:36
Aescleal20-Oct-10 7:36 
QuestionProblem with SelectObject() Pin
ashtwin17-Oct-10 23:52
ashtwin17-Oct-10 23:52 
Hi,
I am using SelectObject() in my code but confused with the MSDN description.
CFont font;	
font.CreateFont(-12, 0, 0, 0, 400, FALSE, TRUE, FALSE, ANSI_CHARSET, OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, _T("Courier New"));	
CFont* oldFont = pdc->SelectObject(font);	
pdc->TextOut(0, 0, str);	
pdc->SelectObject(oldFont);	
font.DeleteObject();

As per MSDN we should not use the object return by SelectObject because it is a temporary one.
But if we are restoring the old GDI object in the above way will it cause any problem
because the same dc can be used in some other place.

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.