2016-12-27 10:27:44 +01:00
|
|
|
|
#include "mainwindow.h"
|
2016-12-26 16:06:55 +01:00
|
|
|
|
#include <QApplication>
|
2016-12-27 10:27:44 +01:00
|
|
|
|
#include <winsock2.h>
|
|
|
|
|
|
|
|
|
|
|
|
// Need to link with Ws2_32.lib
|
|
|
|
|
|
#pragma comment(lib, "ws2_32.lib")
|
2016-12-26 16:06:55 +01:00
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
|
{
|
2016-12-27 10:27:44 +01:00
|
|
|
|
|
|
|
|
|
|
/* Use the MAKEWORD(lowbyte, highbyte) macro declared in Windef.h */
|
|
|
|
|
|
WORD wVersionRequested = MAKEWORD(2, 2);
|
|
|
|
|
|
WSADATA wsaData;
|
|
|
|
|
|
int err = WSAStartup(wVersionRequested, &wsaData);
|
|
|
|
|
|
if (err != 0) {
|
|
|
|
|
|
/* Tell the user that we could not find a usable */
|
|
|
|
|
|
/* Winsock DLL. */
|
|
|
|
|
|
printf("WSAStartup failed with error: %d\n", err);
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-12-26 16:06:55 +01:00
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
|
|
MainWindow w;
|
|
|
|
|
|
w.show();
|
|
|
|
|
|
|
2016-12-27 10:27:44 +01:00
|
|
|
|
int result = a.exec();
|
|
|
|
|
|
|
|
|
|
|
|
WSACleanup();
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
2016-12-26 16:06:55 +01:00
|
|
|
|
}
|