Click here to Skip to main content
15,902,276 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Trapping HTML w/out proxy??? Pin
Michael Dunn10-Feb-01 17:07
sitebuilderMichael Dunn10-Feb-01 17:07 
AnswerRe: Trapping HTML w/out proxy??? Pin
11-Feb-01 11:05
suss11-Feb-01 11:05 
GeneralTransparent CStatic Pin
Tim Jones10-Feb-01 6:10
Tim Jones10-Feb-01 6:10 
GeneralRe: Transparent CStatic Pin
Joe Moldovan10-Feb-01 13:07
Joe Moldovan10-Feb-01 13:07 
General"Don't ask me this again" Pin
10-Feb-01 5:45
suss10-Feb-01 5:45 
GeneralRe: "Don't ask me again" Pin
Daniel Ferguson12-Feb-01 9:25
Daniel Ferguson12-Feb-01 9:25 
GeneralRe: Pin
12-Feb-01 13:51
suss12-Feb-01 13:51 
GeneralSolving leaks Pin
Joe Moldovan10-Feb-01 5:03
Joe Moldovan10-Feb-01 5:03 
Although they don't replace something like SoftICE, the diagnostic tools in VC are sometimes nice. I have just found a short-indexed loop with a "delete *obj" which caused a leak in my app. The tool I used was _CrtDumpMemoryLeaks(). The documentation has this to say:

"_CrtDumpMemoryLeaks is frequently called at the end of program execution to verify that all memory allocated by the application has been freed. The function can be called automatically at program termination by turning on the _CRTDBG_LEAK_CHECK_DF bit field of the _crtDbgFlag flag using the _CrtSetDbgFlag function."

This is typical MSDN doublespeak. It's not exactly wrong, just highly misleading. The two methods give different results. If you call _CrtDumpMemoryLeaks() at the end of your app InitInstance for example, it will detect the main window context and your dynalinks (and I suppose any other external linkage blocks as well) and report them as leaks. Even if you overload your WinApp destructor and put the dump as the very last thing you do in the app, the dynalinks are still detected. You may learn to live with this but I wan't only real leaks reported.

If you include the following code as suggested above,

int tmpDbgFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag( tmpDbgFlag );

you will get the correct result and all reported leaks will be your own doing only.

I don't pretend to be a Windows guru but this might help some poor sod trying to plug the leaks on the moth-bitten MFC object arrays or the poxy MS STL.
GeneralRe: Solving leaks Pin
NormDroid10-Feb-01 5:47
professionalNormDroid10-Feb-01 5:47 
QuestionWebsites? Pin
10-Feb-01 4:54
suss10-Feb-01 4:54 
AnswerRe: Websites? Pin
10-Feb-01 11:03
suss10-Feb-01 11:03 
GeneralHelp..CEdit ( enabling and text selection ) Pin
10-Feb-01 4:47
suss10-Feb-01 4:47 
QuestionWhat is the windows message no. 0x101E is for ? Pin
winyu9-Feb-01 20:01
winyu9-Feb-01 20:01 
AnswerRe: What is the windows message no. 0x101E is for ? Pin
Erik Funkenbusch12-Feb-01 13:11
Erik Funkenbusch12-Feb-01 13:11 
GeneralHotKey in backend process Pin
Vickie9-Feb-01 17:37
Vickie9-Feb-01 17:37 
GeneralToolbar - MFC and COM Pin
9-Feb-01 10:44
suss9-Feb-01 10:44 
GeneralCount item in folder Pin
IAF9-Feb-01 9:07
IAF9-Feb-01 9:07 
GeneralRe: Count item in folder Pin
Daniel Ferguson9-Feb-01 10:05
Daniel Ferguson9-Feb-01 10:05 
QuestionChangin color? Pin
9-Feb-01 8:34
suss9-Feb-01 8:34 
AnswerRe: Changin color? Pin
Daniel Ferguson9-Feb-01 9:46
Daniel Ferguson9-Feb-01 9:46 
GeneralUsage of CArray<> with a CListCtrl derrived class. Pin
Henrik9-Feb-01 6:42
Henrik9-Feb-01 6:42 
GeneralRe: Usage of CArray<> with a CListCtrl derrived class. Pin
Chris Losinger9-Feb-01 8:57
professionalChris Losinger9-Feb-01 8:57 
GeneralRe: Usage of CArray<> with a CListCtrl derrived class. Pin
leonwoo9-Feb-01 13:48
leonwoo9-Feb-01 13:48 
Generalcreateing an unique number runtime Pin
9-Feb-01 5:26
suss9-Feb-01 5:26 
GeneralRe: createing an unique number runtime Pin
Chris Losinger9-Feb-01 6:34
professionalChris Losinger9-Feb-01 6:34 

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.