diff --git a/src/comm/OpalRT.cc b/src/comm/OpalRT.cc new file mode 100644 index 0000000..21917ae --- /dev/null +++ b/src/comm/OpalRT.cc @@ -0,0 +1,26 @@ +#include "OpalRT.h" + +namespace OpalRT +{ + // lastErrorMsg = QString(); + void OpalErrorMsg::displayLastErrorMsg() + { + static QString lastErrorMsg; + setLastErrorMsg(); + QMessageBox msgBox; + msgBox.setIcon(QMessageBox::Critical); + msgBox.setText(lastErrorMsg); + msgBox.exec(); + } + + void OpalErrorMsg::setLastErrorMsg() + { + char* buf = new char[512]; + unsigned short len; + static QString lastErrorMsg; + OpalGetLastErrMsg(buf, sizeof(buf), &len); + lastErrorMsg.clear(); + lastErrorMsg.append(buf); + delete buf; + } +}