Click here to Skip to main content
15,916,463 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Regarding " #if _MSC_VER >= 1100" Pin
Nibu babu thomas18-Sep-06 20:42
Nibu babu thomas18-Sep-06 20:42 
QuestionListing files in a directory Pin
Imtiaz Murtaza18-Sep-06 20:11
Imtiaz Murtaza18-Sep-06 20:11 
AnswerRe: Listing files in a directory Pin
Nibu babu thomas18-Sep-06 20:40
Nibu babu thomas18-Sep-06 20:40 
AnswerRe: Listing files in a directory Pin
Hamid_RT18-Sep-06 21:02
Hamid_RT18-Sep-06 21:02 
AnswerRe: Listing files in a directory Pin
David Crow19-Sep-06 3:54
David Crow19-Sep-06 3:54 
QuestionHow to paint the caption bar Pin
kiranin18-Sep-06 18:50
kiranin18-Sep-06 18:50 
AnswerRe: How to paint the caption bar Pin
prasad_som18-Sep-06 19:29
prasad_som18-Sep-06 19:29 
AnswerRe: How to paint the caption bar Pin
Hamid_RT18-Sep-06 19:31
Hamid_RT18-Sep-06 19:31 
GeneralRe: How to paint the caption bar Pin
kiranin18-Sep-06 19:35
kiranin18-Sep-06 19:35 
GeneralRe: How to paint the caption bar Pin
Hamid_RT18-Sep-06 20:48
Hamid_RT18-Sep-06 20:48 
GeneralRe: How to paint the caption bar Pin
kiranin18-Sep-06 21:36
kiranin18-Sep-06 21:36 
AnswerRe: How to paint the caption bar Pin
Sarath C18-Sep-06 19:42
Sarath C18-Sep-06 19:42 
Questionquestion about getfileattributes function Pin
swatgodjr18-Sep-06 14:39
swatgodjr18-Sep-06 14:39 
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 

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.