Added an error message if a level fails to load.
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <commdlg.h>
|
#include <commdlg.h>
|
||||||
|
#include "ErrorFunctions.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace rapidxml;
|
using namespace rapidxml;
|
||||||
@@ -410,6 +411,12 @@ bool DataModelInstance::load(const char* filename, bool clearObjects)
|
|||||||
name = tname;
|
name = tname;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::stringstream msg;
|
||||||
|
msg << "Failed to load file:" << std::endl << filename << std::endl << strerror(errno);
|
||||||
|
MessageBoxStr(msg.str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DataModelInstance::readXMLFileStream(std::ifstream* file)
|
bool DataModelInstance::readXMLFileStream(std::ifstream* file)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
#include <sstream>
|
||||||
#include "ErrorFunctions.h"
|
#include "ErrorFunctions.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
|
|
||||||
|
|
||||||
void OnError(int err, std::string msg)
|
void OnError(int err, std::string msg)
|
||||||
{
|
{
|
||||||
//g_usableApp->window()->setInputCaptureCount(0);
|
//g_usableApp->window()->setInputCaptureCount(0);
|
||||||
@@ -11,3 +13,17 @@ void OnError(int err, std::string msg)
|
|||||||
MessageBox(NULL, emsg.c_str(), title.c_str(), MB_OK);
|
MessageBox(NULL, emsg.c_str(), title.c_str(), MB_OK);
|
||||||
exit(err);
|
exit(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MessageBoxStr(std::string msg)
|
||||||
|
{
|
||||||
|
std::string title = g_PlaceholderName;
|
||||||
|
MessageBox(NULL, msg.c_str(), title.c_str(), MB_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MessageBoxStream(std::stringstream msg)
|
||||||
|
{
|
||||||
|
std::string strMsg = msg.str();
|
||||||
|
std::string title = g_PlaceholderName;
|
||||||
|
MessageBox(NULL, strMsg.c_str(), title.c_str(), MB_OK);
|
||||||
|
}
|
||||||
@@ -2,3 +2,5 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
void OnError(int err, std::string msg = "");
|
void OnError(int err, std::string msg = "");
|
||||||
|
void MessageBoxStr(std::string msg);
|
||||||
|
void MessageBoxStream(std::stringstream msg);
|
||||||
Reference in New Issue
Block a user