code_app/app/scantool/main.cpp

28 lines
520 B
C++
Raw Normal View History

2024-04-23 09:44:22 +00:00
#include "mainwindow.h"
#include <QApplication>
2024-05-05 09:16:09 +00:00
#include "base/HGDef.h"
2024-04-23 09:44:22 +00:00
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
2024-05-05 09:16:09 +00:00
#ifdef HG_CMP_MSC
HANDLE hMutex = CreateMutexW(NULL, FALSE, L"{A8856E3B-3B67-43e4-82AD-154258C0FD37}");
assert(NULL != hMutex);
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
CloseHandle(hMutex);
return -1;
}
#endif
2024-04-23 09:44:22 +00:00
MainWindow w;
//w.show();
2024-05-05 09:16:09 +00:00
int ret = a.exec();
#ifdef HG_CMP_MSC
CloseHandle(hMutex);
#endif
return ret;
2024-04-23 09:44:22 +00:00
}