Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: question about getfileattributes function Pin
Nibu babu thomas18-Sep-06 17:22
Nibu babu thomas18-Sep-06 17:22 
GeneralRe: question about getfileattributes function Pin
swatgodjr18-Sep-06 17:54
swatgodjr18-Sep-06 17:54 
GeneralRe: question about getfileattributes function Pin
Nibu babu thomas18-Sep-06 17:58
Nibu babu thomas18-Sep-06 17:58 
GeneralRe: question about getfileattributes function Pin
swatgodjr18-Sep-06 18:51
swatgodjr18-Sep-06 18:51 
AnswerRe: question about getfileattributes function Pin
kakan18-Sep-06 22:33
professionalkakan18-Sep-06 22:33 
AnswerRe: question about getfileattributes function Pin
David Crow19-Sep-06 4:00
David Crow19-Sep-06 4:00 
GeneralRe: question about getfileattributes function Pin
swatgodjr19-Sep-06 8:18
swatgodjr19-Sep-06 8:18 
QuestionDo you see the resource leak? Pin
charlieg18-Sep-06 14:23
charlieg18-Sep-06 14:23 
I need extra eyes on this. Below are two examples of some code I have. My application is slowing down over time, so I suspect resource / memory leaks. My tools indicate the following chunk of code leaks a DC. Do you see it? I don't. Look for <<<<<

CWaitDlg::UpdateCursor(CPaintDC *pDC, int nImage)
{
CDC dcBitmap;

dcBitmap.CreateCompatibleDC(pDC); // <<<<<<<< this is where the leak is allegedly.

CBitmap * pOldBitmap = dcBitmap.SelectObject(&m_WaitImages[nImage]);

pDC->BitBlt(m_nCenterX, m_nCenterY, m_Size.cx, m_Size.cy, &dcBitmap, 0, 0, SRCCOPY);

dcBitmap.SelectObject(pOldBitmap);
dcBitmap.DeleteDC();
}


Example #2: this chunk of code is supposed to leak a solid brush. This follows the
typical pattern of create, select it in, use it, deselect, delete.

.
.
.
CBrush brush;
brush.CreateSolidBrush(N_WHITE); //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

CBrush *pOldBrush = dc.SelectObject(&brush);

dc.Ellipse(radioRc);

dc.SelectObject(pOldBrush);

brush.DeleteObject();

dc.SelectObject(pOldPen);
pen.DeleteObject();
.
.
.



Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.

My son's PDA is an M249 SAW.
My other son commutes in an M1A2 Abrams

AnswerRe: Do you see the resource leak? Pin
charlieg18-Sep-06 14:29
charlieg18-Sep-06 14:29 
AnswerRe: Do you see the resource leak? Pin
Stephen Hewitt18-Sep-06 16:26
Stephen Hewitt18-Sep-06 16:26 
AnswerRe: Do you see the resource leak? Pin
charlieg18-Sep-06 16:35
charlieg18-Sep-06 16:35 
AnswerRe: Do you see the resource leak? Pin
Christian Graus18-Sep-06 18:05
protectorChristian Graus18-Sep-06 18:05 
JokeRe: Do you see the resource leak? Pin
charlieg19-Sep-06 4:21
charlieg19-Sep-06 4:21 
AnswerRe: Do you see the resource leak? Pin
charlieg19-Sep-06 8:20
charlieg19-Sep-06 8:20 
QuestionReading from a file input Pin
Jay0318-Sep-06 13:50
Jay0318-Sep-06 13:50 
AnswerRe: Reading from a file input Pin
Stephen Hewitt18-Sep-06 16:28
Stephen Hewitt18-Sep-06 16:28 
QuestionCan't link to a library in Visual studio 2005 Pin
BarryOg18-Sep-06 11:33
BarryOg18-Sep-06 11:33 
AnswerRe: Can't link to a library in Visual studio 2005 Pin
Hamid_RT18-Sep-06 19:36
Hamid_RT18-Sep-06 19:36 
AnswerRe: Can't link to a library in Visual studio 2005 Pin
Cedric Moonen18-Sep-06 20:01
Cedric Moonen18-Sep-06 20:01 
GeneralRe: Can't link to a library in Visual studio 2005 Pin
BarryOg18-Sep-06 20:56
BarryOg18-Sep-06 20:56 
GeneralRe: Can't link to a library in Visual studio 2005 Pin
Cedric Moonen18-Sep-06 21:07
Cedric Moonen18-Sep-06 21:07 
GeneralRe: Can't link to a library in Visual studio 2005 Pin
BarryOg18-Sep-06 22:05
BarryOg18-Sep-06 22:05 
QuestionHow to Output A Character Multiple Times - New To C++ Pin
Mark_Murphy18-Sep-06 11:18
Mark_Murphy18-Sep-06 11:18 
AnswerRe: How to Output A Character Multiple Times - New To C++ Pin
Christian Graus18-Sep-06 12:44
protectorChristian Graus18-Sep-06 12:44 
AnswerRe: How to Output A Character Multiple Times - New To C++ Pin
George L. Jackson18-Sep-06 13:30
George L. Jackson18-Sep-06 13:30 

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.