Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to with Visual c++ and windows sdk, I'm getting nowhere Pin
Richard MacCutchan22-Oct-09 3:46
mveRichard MacCutchan22-Oct-09 3:46 
QuestionInternet Explorer get PDF page count Pin
Subhash Madhukar21-Oct-09 14:45
Subhash Madhukar21-Oct-09 14:45 
AnswerRe: Internet Explorer get PDF page count Pin
Cool_Dev21-Oct-09 22:38
Cool_Dev21-Oct-09 22:38 
GeneralRe: Internet Explorer get PDF page count Pin
Subhash Madhukar22-Oct-09 22:58
Subhash Madhukar22-Oct-09 22:58 
AnswerRe: Internet Explorer get PDF page count Pin
Cool_Dev23-Oct-09 0:25
Cool_Dev23-Oct-09 0:25 
GeneralRe: Internet Explorer get PDF page count Pin
Subhash Madhukar25-Oct-09 14:45
Subhash Madhukar25-Oct-09 14:45 
GeneralRe: Internet Explorer get PDF page count Pin
Cool_Dev25-Oct-09 18:33
Cool_Dev25-Oct-09 18:33 
QuestionRe: Static maps, visual studio and memory leaks Pin
Draemstars21-Oct-09 12:09
Draemstars21-Oct-09 12:09 
Hi guys,
I am almost finished coding a command console for a home project and have just noticed that the static map I used is causing visual studio to whine about leaking memory on program termination. I have included the code for detecting memory leaks
#define _CRTDBG_MAP_ALLOC
        #include <cstdlib>
        #include <crtdbg.h>

and I have an assert an the end of the program.
assert(_CrtDumpMemoryLeaks() == 0);

The program bombs during the assert. If I remove my static map it terminates without blowing up but keep it it and BAM. I should point out that almost all code has been commented out and almost all source files removed. The static map is not used at all. It is the declaration of the static map in the .cpp file that causes the so called memory leak.

I think it is because the maps constructor is called during start up as it is a static variable and its destructor is therefore called on program termination. However this is after the last line of code so the assert will always trigger Sigh | :sigh: .

Is there any way to get visual studio to ignore the static map because I do not think it is an actual memory leak or do I have to have a static pointer to a map instead of a static map and new and delete the stupid thing myself before the assert?

Thx in advance,
Draemstars.
AnswerRe: Static maps, visual studio and memory leaks Pin
«_Superman_»21-Oct-09 13:09
professional«_Superman_»21-Oct-09 13:09 
GeneralRe: Static maps, visual studio and memory leaks Pin
Draemstars22-Oct-09 0:25
Draemstars22-Oct-09 0:25 
GeneralRe: Static maps, visual studio and memory leaks Pin
«_Superman_»22-Oct-09 5:36
professional«_Superman_»22-Oct-09 5:36 
GeneralRe: Static maps, visual studio and memory leaks Pin
Draemstars22-Oct-09 13:19
Draemstars22-Oct-09 13:19 
GeneralRe: Static maps, visual studio and memory leaks Pin
«_Superman_»22-Oct-09 13:33
professional«_Superman_»22-Oct-09 13:33 
GeneralRe: Static maps, visual studio and memory leaks Pin
Chuck O'Toole22-Oct-09 14:16
Chuck O'Toole22-Oct-09 14:16 
GeneralRe: Static maps, visual studio and memory leaks Pin
Draemstars22-Oct-09 23:57
Draemstars22-Oct-09 23:57 
QuestionFindWindowEx, 'handle' and notepad.exe Pin
Ismaele.Jr21-Oct-09 8:31
Ismaele.Jr21-Oct-09 8:31 
QuestionRe: FindWindowEx, 'handle' and notepad.exe Pin
David Crow21-Oct-09 8:54
David Crow21-Oct-09 8:54 
AnswerRe: FindWindowEx, 'handle' and notepad.exe Pin
Ismaele.Jr21-Oct-09 9:23
Ismaele.Jr21-Oct-09 9:23 
QuestionRe: FindWindowEx, 'handle' and notepad.exe Pin
David Crow21-Oct-09 9:29
David Crow21-Oct-09 9:29 
AnswerRe: FindWindowEx, 'handle' and notepad.exe Pin
Ismaele.Jr21-Oct-09 9:55
Ismaele.Jr21-Oct-09 9:55 
GeneralRe: FindWindowEx, 'handle' and notepad.exe Pin
«_Superman_»21-Oct-09 11:11
professional«_Superman_»21-Oct-09 11:11 
GeneralRe: FindWindowEx, 'handle' and notepad.exe Pin
Ismaele.Jr21-Oct-09 11:26
Ismaele.Jr21-Oct-09 11:26 
GeneralRe: FindWindowEx, 'handle' and notepad.exe Pin
«_Superman_»21-Oct-09 11:43
professional«_Superman_»21-Oct-09 11:43 
GeneralRe: FindWindowEx, 'handle' and notepad.exe Pin
Ismaele.Jr21-Oct-09 21:09
Ismaele.Jr21-Oct-09 21:09 
GeneralRe: FindWindowEx, 'handle' and notepad.exe Pin
«_Superman_»21-Oct-09 21:25
professional«_Superman_»21-Oct-09 21:25 

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.