Click here to Skip to main content
15,886,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ variable arguments Pin
Luc Pattyn22-May-11 6:02
sitebuilderLuc Pattyn22-May-11 6:02 
GeneralRe: C++ variable arguments Pin
Sintax122-May-11 7:10
Sintax122-May-11 7:10 
GeneralRe: C++ variable arguments Pin
Luc Pattyn22-May-11 7:31
sitebuilderLuc Pattyn22-May-11 7:31 
AnswerRe: C++ variable arguments Pin
Stefan_Lang23-May-11 2:19
Stefan_Lang23-May-11 2:19 
QuestionMultiple threading Pin
includeh1022-May-11 5:07
includeh1022-May-11 5:07 
AnswerRe: Multiple threading Pin
Mark Salsbery22-May-11 5:27
Mark Salsbery22-May-11 5:27 
AnswerRe: Multiple threading Pin
Luc Pattyn22-May-11 6:06
sitebuilderLuc Pattyn22-May-11 6:06 
QuestionCDC::DrawText Not doing as it's told Pin
softwaremonkey22-May-11 1:40
softwaremonkey22-May-11 1:40 
Guys,

I have a problem with CDC::DrawText() and I have been sitting here wasting away my Sunday trying to figure it out. The problem is that it does not draw the text in the position I expect it to be. The following code is supposed to draw a rectangle, then draw the text in the box, using the style (DT_LEFT, DT_CENTER or DT_RIGHT).

CBrush brush(m_background[nIndex]);
CBrush* pOldBrush = pDC->SelectObject(&brush);
pDC->SetBkColor(m_background[nIndex]);
pDC->SetBkMode(OPAQUE);
pDC->SelectStockObject(NULL_PEN);
pDC->Rectangle(m_hitRect);
pDC->SelectObject(pOldBrush);
pDC->SetBkMode(TRANSPARENT);
pDC->DrawText(txt,m_hitRect, m_nStyle | DT_SINGLELINE | DT_VCENTER);


The text appears in the box (but not in the correct position) when I use DT_CENTER or DT_RIGHT but is not drwn at all with DT_LEFT (I think its outside the rect).

Please help, I really should be cutting the grass! Big Grin | :-D

Tony
AnswerRe: CDC::DrawText Not doing as it's told Pin
Richard MacCutchan22-May-11 3:34
mveRichard MacCutchan22-May-11 3:34 
AnswerRe: CDC::DrawText Not doing as it's told Pin
Mark Salsbery22-May-11 3:54
Mark Salsbery22-May-11 3:54 
GeneralRe: CDC::DrawText Not doing as it's told Pin
softwaremonkey22-May-11 4:59
softwaremonkey22-May-11 4:59 
Questionhow to create chm file Pin
MKC00221-May-11 21:30
MKC00221-May-11 21:30 
AnswerRe: how to create chm file Pin
Richard MacCutchan22-May-11 1:36
mveRichard MacCutchan22-May-11 1:36 
AnswerRe: how to create chm file Pin
Hans Dietrich23-May-11 3:55
mentorHans Dietrich23-May-11 3:55 
AnswerRe: how to create chm file Pin
JohnStein6329-May-11 9:37
JohnStein6329-May-11 9:37 
QuestionArray Count Pin
AmbiguousName21-May-11 10:49
AmbiguousName21-May-11 10:49 
AnswerRe: Array Count Pin
Code-o-mat21-May-11 11:17
Code-o-mat21-May-11 11:17 
AnswerRe: Array Count Pin
Hans Dietrich21-May-11 15:24
mentorHans Dietrich21-May-11 15:24 
QuestionRe: Array Count Pin
David Crow21-May-11 16:24
David Crow21-May-11 16:24 
AnswerRe: Array Count Pin
Software_Developer22-May-11 21:41
Software_Developer22-May-11 21:41 
AnswerRe: Array Count Pin
abhishek.biradar22-May-11 21:47
abhishek.biradar22-May-11 21:47 
Questionspace complexity Pin
moathyy21-May-11 1:45
moathyy21-May-11 1:45 
AnswerRe: space complexity Pin
CPallini21-May-11 3:04
mveCPallini21-May-11 3:04 
AnswerRe: space complexity Pin
Stefan_Lang23-May-11 0:22
Stefan_Lang23-May-11 0:22 
QuestionHow to pass a window handle to another as command line argument. Pin
Nitheesh George20-May-11 22:24
Nitheesh George20-May-11 22:24 

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.