Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 13/04/2001
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: Version.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of Version.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "Version.h"
  16. #ifdef _DEBUG
  17. #undef THIS_FILE
  18. static char THIS_FILE[]=__FILE__;
  19. #define new DEBUG_NEW
  20. #endif
  21. SYSTEMTIME CVersion::m_Time = {0,0,0,0,0,0,0,0};
  22. TCHAR CVersion::m_pTime[MAX_PATH];
  23. CVersion::CVersion( LPCTSTR pTime, LPCTSTR pDate )
  24. {
  25. LPCTSTR pMonth = "JanFebMarAprMayJunJulAugSepOctNovDec";
  26. SYSTEMTIME st;
  27. ::ZeroMemory( &st, sizeof( st ) );
  28. TCHAR pM[MAX_PATH];
  29. _stscanf( pDate, _T("%3s %hu %hu"), pM, &st.wDay, &st.wYear );
  30. st.wMonth = (SHORT)(_tcsstr( pMonth, pM ) - pMonth) / 3 + 1;
  31. _stscanf( pTime, _T("%hu:%hu:%hu"), &st.wHour, &st.wMinute, &st.wSecond );
  32. LARGE_INTEGER t1;
  33. LARGE_INTEGER t2;
  34. FILETIME &ft1 = (FILETIME&)t1;
  35. FILETIME &ft2 = (FILETIME&)t2;
  36. ::SystemTimeToFileTime( &m_Time, (LPFILETIME)&t1 );
  37. ::SystemTimeToFileTime( &st, (LPFILETIME)&t2 );
  38. if( t2.QuadPart > t1.QuadPart )
  39. {
  40. m_Time = st;
  41. // int nCount = ::GetDateFormat( GetThreadLocale(), 0UL, &st, "dd'/'MMM'/'yyyy' '", m_pTime, MAX_PATH );
  42. // ::GetTimeFormat( GetThreadLocale(), 0UL, &st, "HH':'mm':'ss", m_pTime + nCount - 1, MAX_PATH - nCount );
  43. int nCount = ::GetTimeFormat( GetThreadLocale(), 0UL, &st, "HH':'mm':'ss' '", m_pTime, MAX_PATH);
  44. ::GetDateFormat( GetThreadLocale(), 0UL, &st, "dd' 'MMM' 'yyyy", m_pTime + nCount - 1, MAX_PATH - nCount );
  45. }
  46. }
  47. CVersion::~CVersion()
  48. {
  49. }