proto-debuger/protoDebuger/main.cpp

63 lines
1.6 KiB
C++
Raw Normal View History

2021-04-04 18:32:21 +00:00
#include <QApplication>
2021-04-04 02:57:36 +00:00
#include <QQmlApplicationEngine>
2021-04-11 03:28:04 +00:00
#include <QTextCodec>
#include <QByteArray>
#include <QtWidgets/QApplication>
2021-04-12 15:39:06 +00:00
#include <QQuickView>
2021-05-01 06:09:18 +00:00
#include <QtQuickWidgets/QQuickWidget>
2021-04-12 15:39:06 +00:00
#include <QQmlComponent>
#include <QQmlContext>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
2021-04-11 03:28:04 +00:00
#include "sharedata.h"
#include "serialcontroller.h"
2021-04-12 15:39:06 +00:00
#include "lua_wraper.h"
2021-07-12 16:38:29 +00:00
#include "mainwindow.h"
2021-08-29 08:13:50 +00:00
#include <windows.h>
2021-04-04 02:57:36 +00:00
int main(int argc, char *argv[])
{
2021-09-09 16:22:33 +00:00
#ifdef WIN32
WORD wdVersion = MAKEWORD(2, 2);//定义自己需要的网络库版本这里是2.2
WSADATA wdSockMsg;//这是一个结构体
int nRes = WSAStartup(wdVersion, &wdSockMsg);//打开一个套接字
if (0 != nRes) {
switch (nRes) {
case WSASYSNOTREADY:
printf("check your library");
break;
case WSAVERNOTSUPPORTED:
printf("need updated");
break;
case WSAEINPROGRESS:
printf("need reboot");
break;
case WSAEPROCLIM:
printf("sdfsdfsa");
break;
}
}
if (2 != HIBYTE(wdSockMsg.wVersion) || 2 != LOBYTE(wdSockMsg.wVersion)) {
printf("WSACleanup");
WSACleanup();
return 0;
}
#endif
2021-08-29 08:13:50 +00:00
AllocConsole();
freopen("CONOUT$","w",stdout);
2021-08-29 15:50:41 +00:00
QApplication app(argc, argv);
QQmlApplicationEngine engine;
2021-05-01 15:41:40 +00:00
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
2021-05-01 06:09:18 +00:00
2021-08-29 08:13:50 +00:00
printf("hello world");
2021-07-12 16:38:29 +00:00
MainWindow w;
w.setWindowTitle("协议调试器");
w.show();
2021-04-12 15:39:06 +00:00
2021-04-04 02:57:36 +00:00
return app.exec();
}