This project is read-only.

Provide a project template to support CRT debugging features


There have been suggested to support the Debug CRT for detecting memory leaks. Basically it requires two modifications the the test dll project.

First, add the following lines to the test dll's stdafx.h file:


include <crtdbg.h>

And second, insert the following as the first line in the test dll's main .cpp dll file:


int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
int nRetCode = 0;



icnocop wrote Mar 31, 2011 at 4:08 AM

_tmain is an entry point for an application, not a dll.

I followed the steps here:
Finding Memory Leaks Using the CRT Library

I called "_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );" within BEGIN_TEST(){ ... }END_TEST but could not get the file and the line number where the leaked memory is first allocated.

Any ideas?

Thank you.

wrote Feb 14, 2013 at 7:21 PM

wrote Dec 8, 2017 at 8:10 AM