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. "COleDateTime::GetCurrentTime()" Crashes??

"COleDateTime::GetCurrentTime()" Crashes??

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studioquestionworkspace
9 Posts 7 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.
  • V Offline
    V Offline
    VCSharp007
    wrote on last edited by
    #1

    Hi, call to "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication. I am using Windows XP, SP2. Development environment is Visual Studio 6 with Platform SDK for XP SP2. Thanx in advance.

    S P N H G 5 Replies Last reply
    0
    • V VCSharp007

      Hi, call to "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication. I am using Windows XP, SP2. Development environment is Visual Studio 6 with Platform SDK for XP SP2. Thanx in advance.

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      The following information is always helpful when diagnosing a crash: - The type of exception generated. - The machine code around the faulting instruction. - The call stack to the faulting instruction. - The source code around the faulting instruction.

      Steve

      1 Reply Last reply
      0
      • V VCSharp007

        Hi, call to "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication. I am using Windows XP, SP2. Development environment is Visual Studio 6 with Platform SDK for XP SP2. Thanx in advance.

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        I second stephen on this. Give some code.

        Prasad Notifier using ATL | Operator new[],delete[][^]

        1 Reply Last reply
        0
        • V VCSharp007

          Hi, call to "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication. I am using Windows XP, SP2. Development environment is Visual Studio 6 with Platform SDK for XP SP2. Thanx in advance.

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          VCSharp007 wrote:

          "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication

          COleDateTime::GetCurrentTime() has an issue since it uses the underlying time_t type for returning time. Now when year 2038 janhappens time_t reaches it's limit hence wraps around. Instead of COleDateTime::GetCurrentTime() try using GetLocalTime. GetLocalTime returns local system time based on your timezone. This is could be the problem. :~ More info[^]


          Nibu thomas A Developer Programming tips[^]  My site[^]

          D 2 Replies Last reply
          0
          • V VCSharp007

            Hi, call to "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication. I am using Windows XP, SP2. Development environment is Visual Studio 6 with Platform SDK for XP SP2. Thanx in advance.

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            Can you be more specific


            WhiteSky


            1 Reply Last reply
            0
            • V VCSharp007

              Hi, call to "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication. I am using Windows XP, SP2. Development environment is Visual Studio 6 with Platform SDK for XP SP2. Thanx in advance.

              G Offline
              G Offline
              Galatei
              wrote on last edited by
              #6

              Hi, Ensure that COleDateTime::GetCurrentTime() is not assigned directly to other variable than COleDateTime class type. Try if this will throw an exception:

              COleDateTime dateTime = COleDateTime::GetCurrentTime();

              Best regards

              1 Reply Last reply
              0
              • N Nibu babu thomas

                VCSharp007 wrote:

                "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication

                COleDateTime::GetCurrentTime() has an issue since it uses the underlying time_t type for returning time. Now when year 2038 janhappens time_t reaches it's limit hence wraps around. Instead of COleDateTime::GetCurrentTime() try using GetLocalTime. GetLocalTime returns local system time based on your timezone. This is could be the problem. :~ More info[^]


                Nibu thomas A Developer Programming tips[^]  My site[^]

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Nibu babu thomas wrote:

                This is could be the problem.

                How, since we are roughly 32 years away?


                "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                "Judge not by the eye but by the heart." - Native American Proverb

                N 1 Reply Last reply
                0
                • D David Crow

                  Nibu babu thomas wrote:

                  This is could be the problem.

                  How, since we are roughly 32 years away?


                  "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                  "Judge not by the eye but by the heart." - Native American Proverb

                  N Offline
                  N Offline
                  Nibu babu thomas
                  wrote on last edited by
                  #8

                  DavidCrow wrote:

                  How, since we are roughly 32 years away?

                  Yeah true. But our client tested our product with year greater than 2038 to see if such issues are handled properly. Hence I thought this could be the problem, since our application crashed when it was tested like this.


                  Nibu thomas A Developer Programming tips[^]  My site[^]

                  1 Reply Last reply
                  0
                  • N Nibu babu thomas

                    VCSharp007 wrote:

                    "COleDateTime::GetCurrentTime()" get crashed in my MFC aplication

                    COleDateTime::GetCurrentTime() has an issue since it uses the underlying time_t type for returning time. Now when year 2038 janhappens time_t reaches it's limit hence wraps around. Instead of COleDateTime::GetCurrentTime() try using GetLocalTime. GetLocalTime returns local system time based on your timezone. This is could be the problem. :~ More info[^]


                    Nibu thomas A Developer Programming tips[^]  My site[^]

                    D Offline
                    D Offline
                    David Crow
                    wrote on last edited by
                    #9

                    Nibu babu thomas wrote:

                    COleDateTime::GetCurrentTime() has an issue since it uses the underlying time_t...

                    Actually it uses a DATE, which is a double. CTime has the year 2038 problem.


                    "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

                    "Judge not by the eye but by the heart." - Native American Proverb

                    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