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. ATL / WTL / STL
  4. WTL + Time/Date information

WTL + Time/Date information

Scheduled Pinned Locked Moved ATL / WTL / STL
c++question
11 Posts 5 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.
  • E Ernesto D

    Hi all, what can i use in WTL for handling time/date information?, ibe been using the good old SYSTEMTIME struct till now, but now i have to do some time calculations, and its a real pain to do all the convert to FILETIME, etc, etc. stuff just to substract a date from another one! Should i.... 1.- Write my own WTL MFC-CTime equivalent class? 2.- Use COleDateTime? (can i do this without having to link to MFC libs?) 3.- Is there a wonderfull time/date handling class for WTL that i dont know about? Thanks!

    S Offline
    S Offline
    Stuart Dootson
    wrote on last edited by
    #2

    You could try the Boost date/time libraries...[^] You'd probably have to write functions to get to/from native Windows types, though. Stuart Dootson 'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'

    1 Reply Last reply
    0
    • E Ernesto D

      Hi all, what can i use in WTL for handling time/date information?, ibe been using the good old SYSTEMTIME struct till now, but now i have to do some time calculations, and its a real pain to do all the convert to FILETIME, etc, etc. stuff just to substract a date from another one! Should i.... 1.- Write my own WTL MFC-CTime equivalent class? 2.- Use COleDateTime? (can i do this without having to link to MFC libs?) 3.- Is there a wonderfull time/date handling class for WTL that i dont know about? Thanks!

      S Offline
      S Offline
      Steve S
      wrote on last edited by
      #3

      You could consider converting to OLE Date/Time format without COleDateTime, using SystemTimeToVariantTime, which lets you then do subtraction for date/time differences. The integer part of the result is the number of days difference, and you can use VariantTimeToSystemTime to make extracting hh:mm:ss information simpler. Steve S

      1 Reply Last reply
      0
      • E Ernesto D

        Hi all, what can i use in WTL for handling time/date information?, ibe been using the good old SYSTEMTIME struct till now, but now i have to do some time calculations, and its a real pain to do all the convert to FILETIME, etc, etc. stuff just to substract a date from another one! Should i.... 1.- Write my own WTL MFC-CTime equivalent class? 2.- Use COleDateTime? (can i do this without having to link to MFC libs?) 3.- Is there a wonderfull time/date handling class for WTL that i dont know about? Thanks!

        E Offline
        E Offline
        Ernesto D
        wrote on last edited by
        #4

        Thanks Steve & Stuart, i decided to write my own time classes so from now on i never have time-troubles again :) so i wrote CWTime & CElapsedTime and they seem to work sweet so far. Thanks for your answers!

        1 Reply Last reply
        0
        • E Ernesto D

          Hi all, what can i use in WTL for handling time/date information?, ibe been using the good old SYSTEMTIME struct till now, but now i have to do some time calculations, and its a real pain to do all the convert to FILETIME, etc, etc. stuff just to substract a date from another one! Should i.... 1.- Write my own WTL MFC-CTime equivalent class? 2.- Use COleDateTime? (can i do this without having to link to MFC libs?) 3.- Is there a wonderfull time/date handling class for WTL that i dont know about? Thanks!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #5

          If you are lucky enough to get VS.NET, then you can use the classic MFC CTime class - it is now a shared ATL/MFC class (along with CString and others).


          When I am king, you will be first against the wall.

          E 1 Reply Last reply
          0
          • L Lost User

            If you are lucky enough to get VS.NET, then you can use the classic MFC CTime class - it is now a shared ATL/MFC class (along with CString and others).


            When I am king, you will be first against the wall.

            E Offline
            E Offline
            Ernesto D
            wrote on last edited by
            #6

            Hi and thanks for your answer, i do have VS.NET, but about 1 month after buying it, i uninstalled it and went back to 6.0. why? because quite simply, IT SUCKS! :) (please note that i dont start a never ending devate on .net, this is my OWN PERSONAL OPINION, im shure many people find .net lovely) NE way, i allready wrote a pair of time classes for wtl, sort of a "port" of the MFC´s CTime & CTimeSpan classes (ill be glad to share them with anyone interested), and they work just fine. Cheers!

            L T 2 Replies Last reply
            0
            • E Ernesto D

              Hi and thanks for your answer, i do have VS.NET, but about 1 month after buying it, i uninstalled it and went back to 6.0. why? because quite simply, IT SUCKS! :) (please note that i dont start a never ending devate on .net, this is my OWN PERSONAL OPINION, im shure many people find .net lovely) NE way, i allready wrote a pair of time classes for wtl, sort of a "port" of the MFC´s CTime & CTimeSpan classes (ill be glad to share them with anyone interested), and they work just fine. Cheers!

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              I know the VS.NET IDE sucks AND blows but you're missing out on ATL7 which is an excellent set of classes...


              The Rob Blog

              S 1 Reply Last reply
              0
              • L Lost User

                I know the VS.NET IDE sucks AND blows but you're missing out on ATL7 which is an excellent set of classes...


                The Rob Blog

                S Offline
                S Offline
                Steve S
                wrote on last edited by
                #8

                and even better with WTL7 installed, despite the 'glitches' that stop it being easy to install for VS.NET 2003. Why don't MS realise what a success story WTL is, and make it an official part of the product? Is it that they're afraid no-one will use MFC, or is it self-preservation on the part of the author who realises that MS control freaks will kill the product? ;) Steve S

                E 1 Reply Last reply
                0
                • S Steve S

                  and even better with WTL7 installed, despite the 'glitches' that stop it being easy to install for VS.NET 2003. Why don't MS realise what a success story WTL is, and make it an official part of the product? Is it that they're afraid no-one will use MFC, or is it self-preservation on the part of the author who realises that MS control freaks will kill the product? ;) Steve S

                  E Offline
                  E Offline
                  Ernesto D
                  wrote on last edited by
                  #9

                  I think microsoft doesnt support wtl for one reason, They dont have to! or in other words, it wont make them any more money(and thats all they care about), they know that 90% of people will continue to use the arcane, buggy, and overcomplicated MFC libs even if they dont like it because its (sadly) become the "standard" for writting windows apps, and since its what "most people use", even the people that hate MFC (like me), are sometimes FORCED to use it, i had a customer (a systems manager for a hotel in my city) that told me exacly this: "if you dont do it on MFC, then i dont want it", when i asked her why, her answer was sadly true: "because if you do it on wtl, W32, or whatever, i will have a hard time finding some one to maintain it, but if you do it on MFC, then finding someone that knows/uses MFC is not a problem". I think that microsoft should make WTL open source, its (in my opinion) a GREAT library that should continue to get supported, documented, etc.

                  S 1 Reply Last reply
                  0
                  • E Ernesto D

                    I think microsoft doesnt support wtl for one reason, They dont have to! or in other words, it wont make them any more money(and thats all they care about), they know that 90% of people will continue to use the arcane, buggy, and overcomplicated MFC libs even if they dont like it because its (sadly) become the "standard" for writting windows apps, and since its what "most people use", even the people that hate MFC (like me), are sometimes FORCED to use it, i had a customer (a systems manager for a hotel in my city) that told me exacly this: "if you dont do it on MFC, then i dont want it", when i asked her why, her answer was sadly true: "because if you do it on wtl, W32, or whatever, i will have a hard time finding some one to maintain it, but if you do it on MFC, then finding someone that knows/uses MFC is not a problem". I think that microsoft should make WTL open source, its (in my opinion) a GREAT library that should continue to get supported, documented, etc.

                    S Offline
                    S Offline
                    Steve S
                    wrote on last edited by
                    #10

                    Amen to that. Steve S

                    1 Reply Last reply
                    0
                    • E Ernesto D

                      Hi and thanks for your answer, i do have VS.NET, but about 1 month after buying it, i uninstalled it and went back to 6.0. why? because quite simply, IT SUCKS! :) (please note that i dont start a never ending devate on .net, this is my OWN PERSONAL OPINION, im shure many people find .net lovely) NE way, i allready wrote a pair of time classes for wtl, sort of a "port" of the MFC´s CTime & CTimeSpan classes (ill be glad to share them with anyone interested), and they work just fine. Cheers!

                      T Offline
                      T Offline
                      TW
                      wrote on last edited by
                      #11

                      Agreed, too few update to MFC/ATL and the IDE now mix-up with .nut, which make C/C++ more complicated as before. :mad:

                      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