main.cpp 640 B

123456789101112131415161718192021222324252627282930
  1. #ifdef CONFIG_NATIVE_WINDOWS
  2. #include <winsock.h>
  3. #endif /* CONFIG_NATIVE_WINDOWS */
  4. #include <qapplication.h>
  5. #include "wpagui.h"
  6. int main( int argc, char ** argv )
  7. {
  8. QApplication a( argc, argv );
  9. WpaGui w;
  10. int ret;
  11. #ifdef CONFIG_NATIVE_WINDOWS
  12. WSADATA wsaData;
  13. if (WSAStartup(MAKEWORD(2, 0), &wsaData)) {
  14. printf("Could not find a usable WinSock.dll\n");
  15. return -1;
  16. }
  17. #endif /* CONFIG_NATIVE_WINDOWS */
  18. w.show();
  19. a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
  20. ret = a.exec();
  21. #ifdef CONFIG_NATIVE_WINDOWS
  22. WSACleanup();
  23. #endif /* CONFIG_NATIVE_WINDOWS */
  24. return ret;
  25. }