test.cpp 871 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // test.cpp : 定义控制台应用程序的入口点。
  2. //
  3. #include "stdafx.h"
  4. #include "test.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #endif
  8. // 唯一的应用程序对象
  9. CWinApp theApp;
  10. using namespace std;
  11. int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
  12. {
  13. int nRetCode = 0;
  14. // 初始化 MFC 并在失败时显示错误
  15. if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
  16. {
  17. // TODO: 更改错误代码以符合您的需要
  18. _tprintf(_T("错误: MFC 初始化失败\n"));
  19. nRetCode = 1;
  20. }
  21. else
  22. {
  23. // TODO: 在此处为应用程序的行为编写代码。
  24. if ( LoadLogLibarary() )
  25. {
  26. // 启动服务;
  27. if ( g_logStart(5566) )
  28. TRACE("start ok\r");
  29. else
  30. TRACE("start faild\r");
  31. g_logEnable(true);
  32. g_Setlogpath("E:\\bin\\aa\\aa.txt");
  33. printf("%lf\r\r",g_GetTime());
  34. system("pause");
  35. g_logEnable(true);
  36. g_logStop();
  37. FreeLogLibarary();
  38. }
  39. }
  40. return nRetCode;
  41. }