timmay3141
Programmer
I'm writing a win32 app (no MFC), and I am allocating memory in it. Whenever I created a new class, I let the compiler to create the correct .h and .cpp. I noticed at the top of every .cpp file it has these lines of code:
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
This didn't seem to hurt anything, so I ignored them. However, later I needed to allocate memory. I get the following error message on a line that looks like this:
m_lpStr = new TCHAR[len];
error C2065: 'DEBUG_NEW' : undeclared identifier
I deleted the wierd code and it works fine now, but I don't want to delete something that may be necessary somewhere else. What exactly is this trying to do? Is the problem that I am not using MFC?
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
This didn't seem to hurt anything, so I ignored them. However, later I needed to allocate memory. I get the following error message on a line that looks like this:
m_lpStr = new TCHAR[len];
error C2065: 'DEBUG_NEW' : undeclared identifier
I deleted the wierd code and it works fine now, but I don't want to delete something that may be necessary somewhere else. What exactly is this trying to do? Is the problem that I am not using MFC?