Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to print SYSTEMTIME

how to print SYSTEMTIME

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++helptutorial
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mihai123
    wrote on last edited by
    #1

    Hello I'm new in MFC and all this small and ease tasks in c# seems to me very impossible in MFC. I'm trying to do a log file. I need to take the current system time and date and then transformed it in CString in order to write them in the file. Tnx for the help, And have a nice weekend.

    M R 2 Replies Last reply
    0
    • M mihai123

      Hello I'm new in MFC and all this small and ease tasks in c# seems to me very impossible in MFC. I'm trying to do a log file. I need to take the current system time and date and then transformed it in CString in order to write them in the file. Tnx for the help, And have a nice weekend.

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      Use CString::Format (or sprintf in the example below) see this[^] for an example.

      Maximilien Lincourt Your Head A Splode - Strong Bad

      1 Reply Last reply
      0
      • M mihai123

        Hello I'm new in MFC and all this small and ease tasks in c# seems to me very impossible in MFC. I'm trying to do a log file. I need to take the current system time and date and then transformed it in CString in order to write them in the file. Tnx for the help, And have a nice weekend.

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        mihai123 wrote:

        all this small and ease tasks in c# seems to me very impossible in MFC.

        You mean MFC is hard? You must write an ActiveX control in plain Win32, my friend :rolleyes:

        SYSTEMTIME time;
        GetSystemTime(&time);
        CString str;
        str.Format("Year: %d, Month:%d, Day of month:%d, 
                        Day of week:%d",time.wYear, time.wMonth, time.wDay, time.wDayOfWeek);
        AfxMessageBox(str);
        

        Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

        C 1 Reply Last reply
        0
        • R Rajesh R Subramanian

          mihai123 wrote:

          all this small and ease tasks in c# seems to me very impossible in MFC.

          You mean MFC is hard? You must write an ActiveX control in plain Win32, my friend :rolleyes:

          SYSTEMTIME time;
          GetSystemTime(&time);
          CString str;
          str.Format("Year: %d, Month:%d, Day of month:%d, 
                          Day of week:%d",time.wYear, time.wMonth, time.wDay, time.wDayOfWeek);
          AfxMessageBox(str);
          

          Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          Rajesh R Subramanian wrote:

          You mean MFC is hard? You must write an ActiveX control in plain Win32, my friend

          Never used MFC for that. ATL was far much better ;P .

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

          R 1 Reply Last reply
          0
          • C CPallini

            Rajesh R Subramanian wrote:

            You mean MFC is hard? You must write an ActiveX control in plain Win32, my friend

            Never used MFC for that. ATL was far much better ;P .

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #5

            CPallini wrote:

            ATL was far much better

            No, the point was that the OP said doing things with MFC is hard. So, I thought how nice it must be for the OP to write an ActiveX control with Win32, not even MFC. :rolleyes:

            Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups