This project has moved. For the latest updates, please go here.

Leak Report in an Empty project (Windows 7 64Bits + VS2010)

Dec 12, 2016 at 10:05 AM
A empty project in VS2010, in stdafx.h add #include <vld.h>
After run the project ,

the below message report by Visual Leak Detector

WARNING: Visual Leak Detector detected memory leaks!
e:\develop_doc\TestProject\work2\TestProject_x64\TestProject\TestProject.cpp (170): TestProject.exe!CTestProjectApp::InitInstance() + 0x15 bytes
mfc100d.dll!0x0000000051C7C419()
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\appmodul.cpp (26): TestProject.exe!WinMain()
f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crtexe.c (547): TestProject.exe!__tmainCRTStartup() + 0x42 bytes
f:\dd\vctools\crt_bld\self_64_amd64\crt\src\crtexe.c (371): TestProject.exe!WinMainCRTStartup()
kernel32.dll!BaseThreadInitThunk() + 0xD bytes
ntdll.dll!RtlUserThreadStart() + 0x21 bytes
.....

Why? The VS2010 MFC has problem?
Dec 15, 2016 at 9:35 AM
Edited Dec 15, 2016 at 9:35 AM
Hi, You may be experiencing the same issue that I had a while ago, please see this post:
Empty MFC Single Dialog App reports 9 leaks

The solution for me was to place the #include "vld.h" line as the fist line of your stdafx.h file. Do not include "vld.h" in any other file.
Coordinator
Jan 30 at 5:45 PM
Don't forget to load symbols for mfc100d.dll
Feb 8 at 10:35 AM
Yes, I read it.
And after I move the "#include <vld.h>" to the top of the file "stdafx.h", there is no confused report any more.
Thanks
Feb 8 at 10:36 AM
Yes, I find this file ok.