home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Using Visual C++ 4 (Special Edition)
/
Using_Visual_C_4_Special_Edition_QUE_1996.iso
/
ch16
/
myerror.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-13
|
884b
|
36 lines
#include "myerror.h"
CMyErrorClass :: Init()
{
char key[KEY_SIZE];
CString description;
sprintf(key,"%d",_HEAPBADBEGIN);
description.LoadString(IDS_HEADBADBEGIN);
err_msg[key] = description;
sprintf(key,"%d",_HEAPBADNODE);
description.LoadString(IDS_HEAPBADNODE);
err_msg[key] = description;
sprintf(key,"%d",_HEAPBADPTR);
description.LoadString(IDS_HEAPBADPTR);
err_msg[key] = description;
sprintf(key,"%d",_HEAPEMPTY);
description.LoadString(IDS_HEAPEMPTY);
err_msg[key] = description;
sprintf(key,"%d",_HEAPOK);
description.LoadString(IDS_HEAPOK);
err_msg[key] = description;
}
CMyErrorClass::display( int index )
{
char key[KEY_SIZE];
sprintf(key,index);
CString message;
if ( err_msg.Lookup( key, message ) )
TRACE("Error message is : %s", (const char *) message);
else
TRACE1("No Error message for %d",index);
}