Revision 1919 trunk/client/gui_qt/main.cpp

main.cpp (revision 1919)
21 21
    qInstallMsgHandler(messagehandler);
22 22
    NGApplication a(argc, argv);
23 23

                
24
#ifdef WIN32
25
    /* Initialise Winsock */
26
    WORD wVersionRequested;
27
    WSADATA wsaData;
28
    int ret;
29

                
30
    wVersionRequested = MAKEWORD(2, 2);
31

                
32
    ret = WSAStartup(wVersionRequested, &wsaData);
33
    if (ret != 0) {
34
        /* Tell the user that we could not find a usable */
35
        /* WinSock DLL.                                  */
36
        qWarning(QObject::tr("Winsock could not be initialised").toUtf8().data());
37
        return -1;
38
    }
39

                
40
    /* Confirm that the WinSock DLL supports 2.2.        */
41
    /* Note that if the DLL supports versions greater    */
42
    /* than 2.2 in addition to 2.2, it will still return */
43
    /* 2.2 in wVersion since that is the version we      */
44
    /* requested.                                        */
45

                
46
    if (LOBYTE( wsaData.wVersion ) != 2 ||
47
        HIBYTE( wsaData.wVersion ) != 2) {
48
        /* Tell the user that we could not find a usable */
49
        /* WinSock DLL.                                  */
50
        WSACleanup();
51

                
52
        qWarning(QObject::tr("Winsock 2.2 or higher is required for this program").toUtf8().data());
53

                
54
        return -1;
55
    }
56

                
57
    // exchndl.dll is part of Dr. MinGW. By loading this DLL, every time the
58
    // program crashes a .RPT file will be created containing the backtrace
59
    LoadLibraryA("exchndl.dll");
60
#endif
61

                
62 24
    QNNTPGrabGlue::utilsPerformBaseInitialization();
63 25

                
64 26
    /* Verify that there's no other instance of NNTPGrab running already */

Also available in: Unified diff