Skip to content
OpalRT.cc 505 B
Newer Older
Don Gagne's avatar
Don Gagne committed
#include "QGCMessageBox.h"
//    lastErrorMsg = QString();
void OpalErrorMsg::displayLastErrorMsg()
{
    static QString lastErrorMsg;
    setLastErrorMsg();
Don Gagne's avatar
Don Gagne committed
    QGCMessageBox::critical(QString(), lastErrorMsg);
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;
}