Click here to Skip to main content
15,894,405 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem with print function ? Pin
Lewis0113-May-07 10:31
Lewis0113-May-07 10:31 
AnswerRe: Problem with print function ? Pin
bob1697213-May-07 10:57
bob1697213-May-07 10:57 
GeneralRe: Problem with print function ? Pin
Lewis0113-May-07 11:05
Lewis0113-May-07 11:05 
GeneralRe: Problem with print function ? Pin
bob1697213-May-07 11:27
bob1697213-May-07 11:27 
GeneralRe: Problem with print function ? Pin
David Crow14-May-07 3:34
David Crow14-May-07 3:34 
QuestionTrying to use m_strSort with OLE DB Pin
Lewis0113-May-07 10:27
Lewis0113-May-07 10:27 
QuestionMemory leak found after reporting "No memory leaks detected" Pin
dum13-May-07 8:04
dum13-May-07 8:04 
AnswerRe: Memory leak found after reporting "No memory leaks detected" Pin
bob1697213-May-07 9:30
bob1697213-May-07 9:30 
dum wrote:
What can it be?


Disclaimer: I have no experience with other leak detector tools except what VC++ alerts me to.

In my experience, typical leaks occur when I use BSTR without a wrapper, failure to release a device context(ReleaseDC) after using GetDC(), and the obvious new/delete mismatched pairs.

You should search for the obvious sources in your code first. Any usage of a raw BSTR should be considered suspect (Not necessarily bad but at least scrutinize who "owns" the BSTR) as well as GetDC() and all memory allocation.

The execution paths should be scrutinized as posted sample code usually makes many assumptions about the success of operations to keep the snippet short and can mislead proper robust deallocation schemes. For instance, allocating and deallocating within the same scope can be dangerous if there are potential execution paths that can skip over the deallocation. Try/Catch is one of the likely places to forget alternate execution paths when allocation/deallocation is involved.

I Hope that helps.
QuestionRe: Memory leak found after reporting "No memory leaks detected" Pin
dum13-May-07 11:16
dum13-May-07 11:16 
AnswerRe: Memory leak found after reporting "No memory leaks detected" Pin
bob1697213-May-07 12:06
bob1697213-May-07 12:06 
QuestionRe: Memory leak found after reporting "No memory leaks detected" Pin
dum13-May-07 12:11
dum13-May-07 12:11 
QuestionRe: Memory leak found after reporting "No memory leaks detected" Pin
dum13-May-07 12:13
dum13-May-07 12:13 
AnswerRe: Memory leak found after reporting "No memory leaks detected" Pin
cmk13-May-07 14:55
cmk13-May-07 14:55 
QuestionRe: Memory leak found after reporting "No memory leaks detected" Pin
dum13-May-07 15:15
dum13-May-07 15:15 
AnswerRe: Memory leak found after reporting "No memory leaks detected" Pin
Mark Salsbery14-May-07 5:09
Mark Salsbery14-May-07 5:09 
GeneralRe: Memory leak found after reporting "No memory leaks detected" Pin
dum18-May-07 9:27
dum18-May-07 9:27 
QuestionPlatform SDK Pin
<color>Aljechin 13-May-07 6:48
<color>Aljechin 13-May-07 6:48 
AnswerRe: Platform SDK Pin
Sam_c13-May-07 6:57
Sam_c13-May-07 6:57 
AnswerRe: Platform SDK Pin
Michael Dunn13-May-07 17:40
sitebuilderMichael Dunn13-May-07 17:40 
GeneralRe: Platform SDK Pin
Sam_c13-May-07 21:58
Sam_c13-May-07 21:58 
QuestionInput from LPT port with inpout32.dll on windows XP Pin
Johpoke13-May-07 6:44
Johpoke13-May-07 6:44 
QuestionWriting/reading to/from CSV files Pin
J_E_D_I13-May-07 6:00
J_E_D_I13-May-07 6:00 
QuestionRe: Writing/reading to/from CSV files Pin
David Crow14-May-07 3:38
David Crow14-May-07 3:38 
AnswerRe: Writing/reading to/from CSV files Pin
J_E_D_I14-May-07 4:18
J_E_D_I14-May-07 4:18 
GeneralRe: Writing/reading to/from CSV files Pin
David Crow14-May-07 4:26
David Crow14-May-07 4:26 

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.