I just read your entire post, seem like a leap year bug. Because when I set
If you are not setting the day for your control, then today it will
default to 30 which feb doesn't have, and then breaks things.
So do this to fix it:
COleDateTime CurTime = COleDateTime::GetCurrentTime();
COleDateTime Time(CurTime.GetYear(),CurTime.GetMonth(),1,12,0,0);
m_DateTimeCtrl.SetTime(Time);
m_DateTimeCtrl.SetFormat("MMMM yyyy");
AliR.
"Eric Margheim" <nospam***ericm@charter.net> wrote in message
news:eFSM%23u3YIHA.4160@TK2MSFTNGP03.phx.gbl...
Our application is exhibiting a strange bug today out of the blue. The
CDateTimeCtrl is exhibiting a strange behavior. I have it set so that
the format is MMMM YYYY so we don't see the day. If it's set as a spin
control or if you use the arrows to inc/dec the month it doesn't show
February. It goes from January to <blank) then to March. By default
it's populated with today's date.
Jan 30 and Jan 31 cause problems. It's behaving like it think the month
is actually February where 30th and 31st don't exist.
Shouldn't the control automatically increment the day to a valid value
when changing month to February? It does this with other months where
31st isn't valid. It must be a leap year bug?