Click here to Skip to main content
16,006,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Very simple questions ... Pin
24-May-01 1:04
suss24-May-01 1:04 
GeneralDirectshow (DES) Pin
21-May-01 0:36
suss21-May-01 0:36 
GeneralDirectX with Visual C++ Pin
21-May-01 0:15
suss21-May-01 0:15 
GeneralRe: DirectX with Visual C++ Pin
Tomasz Sowinski21-May-01 0:24
Tomasz Sowinski21-May-01 0:24 
GeneralRe: Printing a CRichEditCtrl Pin
Tomasz Sowinski21-May-01 0:03
Tomasz Sowinski21-May-01 0:03 
GeneralSaveDC & RestoreDC Pin
José Luis Sogorb20-May-01 23:30
José Luis Sogorb20-May-01 23:30 
GeneralRe: SaveDC & RestoreDC Pin
Tomasz Sowinski21-May-01 0:32
Tomasz Sowinski21-May-01 0:32 
GeneralRe: SaveDC & RestoreDC Pin
José Luis Sogorb21-May-01 1:20
José Luis Sogorb21-May-01 1:20 
OK, that was the solution. I've changed to:

In OnDraw function...

CPen m_pPincelR, m_pPincelN, m_pPincelA, m_pPincelM, m_pPincelV;
CFont m_pLetraP, m_pLetraG;

m_pLetraG.CreateFont(16,0,0,0,FW_SEMIBOLD,FALSE,FALSE,FALSE,
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
18,"Times New Roman");

m_pLetraP.CreateFont(15,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
18,"Times New Roman");

m_pPincelR.CreatePen(PS_SOLID,2,RGB(255,0,0));
m_pPincelN.CreatePen(PS_SOLID,2,RGB(255,96,0));
m_pPincelA.CreatePen(PS_SOLID,2,RGB(0,255,255));
m_pPincelM.CreatePen(PS_SOLID,2,RGB(255,0,255));
m_pPincelV.CreatePen(PS_SOLID,2,RGB(0,255,0));

{
CSaveDC sdc (pDC);
pDC->SelectObject(m_pLetraG);
pDC->TextOut(25,-2,actual);

pDC->SelectObject(m_pLetraP);

..more TextOut...

pDC->SelectObject(m_pPincelR);

...drawing functions...

pDC->SelectObject(m_pPincelN);

...drawing functions...

pDC->SelectObject(m_pPincelA);

...drawing functions...

pDC->SelectObject(m_pPincelM);

...drawing functions...

pDC->SelectObject(m_pPincelV);

...drawing functions...

}
... OnDraw follows...

And it works fine, I've tried to redraw many times and there is not memory consumption.
Thanks, so much.

GeneralRe: SaveDC & RestoreDC Pin
José Luis Sogorb21-May-01 2:59
José Luis Sogorb21-May-01 2:59 
Questionhow to convert from CString to LPSTR Pin
hearties20-May-01 22:57
hearties20-May-01 22:57 
AnswerRe: how to convert from CString to LPSTR Pin
Christian Graus20-May-01 23:43
protectorChristian Graus20-May-01 23:43 
AnswerRe: how to convert from CString to LPSTR Pin
Dharne Atul20-May-01 23:43
Dharne Atul20-May-01 23:43 
AnswerRe: how to convert from CString to LPSTR Pin
Dharne Atul20-May-01 23:43
Dharne Atul20-May-01 23:43 
GeneralEffects tab in Display Properties dialog box Pin
Nikolay Denisov20-May-01 22:45
Nikolay Denisov20-May-01 22:45 
GeneralRe: Effects tab in Display Properties dialog box Pin
Ben Burnett21-May-01 18:58
Ben Burnett21-May-01 18:58 
GeneralCByteArray to CStatic and vice versa Pin
Jose Luis20-May-01 22:45
Jose Luis20-May-01 22:45 
QuestionWhich method of CDialog fits the size of the dialog window to the size of the screen? Pin
20-May-01 21:31
suss20-May-01 21:31 
AnswerWhy no one answer me ??? Pin
21-May-01 0:28
suss21-May-01 0:28 
GeneralRe: Why no one answer me ??? Pin
#realJSOP21-May-01 0:45
professional#realJSOP21-May-01 0:45 
Generalwhat do the method: MapDialogRect() ?? Pin
21-May-01 4:54
suss21-May-01 4:54 
GeneralRe: what do the method: MapDialogRect() ?? Pin
Chris Losinger21-May-01 5:03
professionalChris Losinger21-May-01 5:03 
GeneralRGB macro Pin
hearties20-May-01 21:28
hearties20-May-01 21:28 
GeneralRe: RGB macro Pin
Christian Graus21-May-01 0:13
protectorChristian Graus21-May-01 0:13 
QuestionHow can I post some data to a webpage? Pin
Shuyi Vi20-May-01 21:26
Shuyi Vi20-May-01 21:26 
AnswerRe: How can I post some data to a webpage? Pin
Anders Molin20-May-01 21:42
professionalAnders Molin20-May-01 21:42 

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.