I recently inherited a "supposedly" running program that I have to provide support and enhancments for. When I attempt to run the code in the Visual C++ 6 IDE, it seems to run fine until the destructor of one of the classes is called. Then I get the following Debug Error: "DAMAGE: after Normal block (#56) at 0x00304700.
I've traced the problem down to a "delete" statement, but I haven't been able to determine exactly what's wrong with it.
Here's the relevant code:
// Header file (.h)
class MailRoomStarter : public NTService
// Stop the use of default and copy constructors
// CPP file (.CPP)
MailRoomStarter::MailRoomStarter(const char* srvname,
) : NTService(srvname, fpSrvMain, fpSrvCtrl)
mStat.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
GetRegistryString(HKEY_LOCAL_MACHINE, "\\SOFTWARE\\xxx\\yyy\\Common\\ExePath", path);
m_MailRoomProgramPath = new char[strlen(path)];
if(m_MailRoomProgramPath != NULL)
// this is where the error occurs
I've tried altering the delete line to the following:
delete  m_MailRoomProgramPath;
...but, I still get the same error.
If anyone has any suggestions, I'd appreciate it.