main.cpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #include "dialog.h"
  2. #include <QApplication>
  3. //typedef HWND(WINAPI *PROCGETCONSOLEWINDOW)();
  4. //PROCGETCONSOLEWINDOW GetConsoleWindowAPI;
  5. //int iNum = 0;
  6. #define ISAPI_OUT_LEN 3 * 1024 * 1024
  7. #define ISAPI_STATUS_LEN 8*1024
  8. //时间解析宏定义
  9. #define GET_YEAR(_time_) (((_time_)>>26) + 2000)
  10. #define GET_MONTH(_time_) (((_time_)>>22) & 15)
  11. #define GET_DAY(_time_) (((_time_)>>17) & 31)
  12. #define GET_HOUR(_time_) (((_time_)>>12) & 31)
  13. #define GET_MINUTE(_time_) (((_time_)>>6) & 63)
  14. #define GET_SECOND(_time_) (((_time_)>>0) & 63)
  15. int main(int argc, char *argv[])
  16. {
  17. // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  18. QApplication a(argc, argv);
  19. Dialog w;
  20. // NET_DVR_Init();
  21. w.show();
  22. //---------------------------------------
  23. // 初始化
  24. // NET_DVR_Init();
  25. // //设置连接时间与重连时间
  26. // NET_DVR_SetConnectTime(2000, 1);
  27. // NET_DVR_SetReconnect(10000, true);
  28. //---------------------------------------
  29. //设置异常消息回调函数
  30. // NET_DVR_SetExceptionCallBack_V30(0, NULL, g_ExceptionCallBack, NULL);
  31. //---------------------------------------
  32. // 获取控制台窗口句柄
  33. //HMODULE hKernel32 = GetModuleHandle("kernel32");
  34. // GetConsoleWindowAPI = (PROCGETCONSOLEWINDOW)GetProcAddress(hKernel32, "GetConsoleWindow");
  35. //设置中文字体
  36. a.setFont(QFont("Microsoft Yahei", 9));
  37. //设置中文编码
  38. // #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0))
  39. // #if _MSC_VER
  40. // QTextCodec *codec = QTextCodec::codecForName("GBK");
  41. // #else
  42. // QTextCodec *codec = QTextCodec::codecForName("UTF-8");
  43. // #endif
  44. // QTextCodec::setCodecForLocale(codec);
  45. // QTextCodec::setCodecForCStrings(codec);
  46. // QTextCodec::setCodecForTr(codec);
  47. // #else
  48. // QTextCodec *codec = QTextCodec::codecForName("UTF-8");
  49. // QTextCodec::setCodecForLocale(codec);
  50. // #endif
  51. return a.exec();
  52. }