#include using namespace std; #include using namespace KException; namespace KException { KWinException:: KWinException() { err_code = -1; err_string = ""; err_description = ""; err_filename = ""; err_line = 0; err_funcname = ""; err_msg = ""; } KWinException:: KWinException(const KWinException& e) { err_code = e.err_code; err_string = e.err_string; err_description = e.err_description; err_filename = e.err_filename; err_line = e.err_line; err_funcname = e.err_funcname; err_msg = e.err_msg; } KWinException:: ~KWinException() { } void KWinException:: ConstructErrorMsg(void) { stringstream sstream_error_info; sstream_error_info << " " << err_code << ":" << err_string << endl\ << " File: " << err_filename << endl\ << " Function: " << err_funcname << endl\ << " Line: " << err_line << endl; err_msg = sstream_error_info.str(); } void KWinException:: DisplayErrorMsg(void) { // Copy the C++ string into a TCHAR array // before passing it to the WinAPI function int msg_len = err_msg.length(); int i; TCHAR * temp = new TCHAR[msg_len]; for(i=0; i