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. Bug in CMonthCalCtrl class ??

Bug in CMonthCalCtrl class ??

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiohelptutorial
2 Posts 1 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.
  • Q Offline
    Q Offline
    Qadddd
    wrote on last edited by
    #1

    Hello, I was trying to create a dialog containing a calendar, so I decided to use the Month Calendar proposed by VC++ in the control bar. But during the execution, when I click the calendar and display the selected day, I remarked that the day was wrong, 12 days more than the day I effectively clicked ... I search in the MSDN CD to find an example and install the CmnCtrl1 project. The MSDN project calendar reacts in the same way, 12 days more as soon as you click on another day that the current day. Do I miss something in the use of this control ? Is it bugged ? If yes, is there a solution/workaround ? Can I use it with Win2K ? Thanks in advance DD PS : I use Visual Studio 6.0 with Win2K

    Q 1 Reply Last reply
    0
    • Q Qadddd

      Hello, I was trying to create a dialog containing a calendar, so I decided to use the Month Calendar proposed by VC++ in the control bar. But during the execution, when I click the calendar and display the selected day, I remarked that the day was wrong, 12 days more than the day I effectively clicked ... I search in the MSDN CD to find an example and install the CmnCtrl1 project. The MSDN project calendar reacts in the same way, 12 days more as soon as you click on another day that the current day. Do I miss something in the use of this control ? Is it bugged ? If yes, is there a solution/workaround ? Can I use it with Win2K ? Thanks in advance DD PS : I use Visual Studio 6.0 with Win2K

      Q Offline
      Q Offline
      Qadddd
      wrote on last edited by
      #2

      In fact, I found the solution on another forum. Here is the wrong code proposed by microsoft : CString pDate; CTime ct; if( m_MonthCal_1.GetCurSel(ct) ) { pDate.Format(_T("%02d/%02d/%2d"),ct.GetMonth(),ct.GetDay(),ct.GetYear()); AfxMessageBox(pDate); // just for testing } Here is the right code : CString pDate; SYSTEMTIME ct; if( m_MonthCal_1.GetCurSel(&ct) ) { pDate.Format(_T("%02d/%02d/%2d"),ct.wMonth ,ct.wDay, ct.wYear ); AfxMessageBox(pDate); // just for testing } The correct way is to use a SYSTEMTIME instead of a CTime type ... DD

      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