<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Serialize CDateTimeCtrl state impossible?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : General Discussion : Serialize CDateTimeCtrl state impossible?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 27 Apr 2026 17:24:39 +0000</pubDate>
  <lastBuildDate>Tue, 04 Aug 2009 03:01:12 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=14024</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : Strange. Anyway, you don&amp;#039;t...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51566&amp;title=serialize-cdatetimectrl-state-impossible#51566</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 04 August 2009 at 3:01am<br /><br />Strange. Anyway, you don't have to assign it if it is invalid.<DIV>&nbsp;</DIV><DIV>if ((pDTChange-&gt;<FONT color=#010001 size=2><FONT color=#010001 size=2>dwFlags == GDT_VALID)</FONT></FONT></DIV><DIV><FONT color=#010001 size=2>&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#000000>m_lastDate = pDTChange-&gt;st;</FONT></FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Strange indeed, since my date value is not changed when debugging during "unchecking"...</FONT></DIV>]]>
   </description>
   <pubDate>Tue, 04 Aug 2009 03:01:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51566&amp;title=serialize-cdatetimectrl-state-impossible#51566</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : Sure I did before posting:  void...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51550&amp;title=serialize-cdatetimectrl-state-impossible#51550</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 03 August 2009 at 2:54pm<br /><br />Sure I did before posting: <FONT color=#0000ff size=2><P>void</FONT><FONT size=2> CMFC_DATEDlg::OnDateTimeChanged(NMHDR *pNMHDR, LRESULT *pResult){</P><P>LPNMDATETIMECHANGE pDTChange = </FONT><FONT color=#0000ff size=2>reinterpret_cast</FONT><FONT size=2>&lt;LPNMDATETIMECHANGE&gt;(pNMHDR);</P><P>m_lastDate = pDTChange-&gt;st; </FONT><FONT size=2>SetWindowText(m_lastDate.Format()); *pResult = 0; }</P><DIV><img src="https://forum.codejock.com/uploads/20090803_145950_ScreenShot1.jpg" border="0"></DIV><P></FONT>&nbsp;</P>]]>
   </description>
   <pubDate>Mon, 03 Aug 2009 14:54:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51550&amp;title=serialize-cdatetimectrl-state-impossible#51550</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : Disagree.  If you use ON_NOTIFY_REFLECT_EX()...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51548&amp;title=serialize-cdatetimectrl-state-impossible#51548</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 03 August 2009 at 2:37pm<br /><br />Disagree.<DIV>&nbsp;</DIV><DIV><EM>If you use <B>ON_NOTIFY_REFLECT_EX()</B> in your message map, your message handler may or may not allow the parent window to handle the message. If the handler returns <B>FALSE</B>, the message will be handled by the parent as well, while a call that returns <B>TRUE</B> does not allow the parent to handle it.</EM></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>And</DIV><DIV>&nbsp;</DIV><DIV><EM>If you want more than one object in the notification routing to handle a message, you can use <B>ON_NOTIFY_EX</B> (or <B>ON_NOTIFY_EX_RANGE</B>) rather than <B>ON_NOTIFY</B> (or <B>ON_NOTIFY_RANGE</B>).</EM></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>If the user unchecks the control, m_lastDate is assigned a valid date. Just verified this.</DIV>]]>
   </description>
   <pubDate>Mon, 03 Aug 2009 14:37:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51548&amp;title=serialize-cdatetimectrl-state-impossible#51548</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : No - this is not true - in the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51332&amp;title=serialize-cdatetimectrl-state-impossible#51332</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 26 July 2009 at 3:07am<br /><br />No - this is not true - in the moment user uncheck control - <FONT color=#010001 size=2>m_lastDate will have invalid data. Proper syntax for notification - void - you can&nbsp;use *pResult to pass TRUE or FALSE)</FONT>]]>
   </description>
   <pubDate>Sun, 26 Jul 2009 03:07:58 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51332&amp;title=serialize-cdatetimectrl-state-impossible#51332</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : Thanks for your hints.  Though,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51306&amp;title=serialize-cdatetimectrl-state-impossible#51306</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 25 July 2009 at 2:38am<br /><br />Thanks for your hints.<DIV>&nbsp;</DIV><DIV>Though, I believe this is the best solution:</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#010001 size=2><FONT color=#010001 size=2><DIV>BOOL</FONT></FONT><FONT size=2> </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>CDateTimeCtrlEx</FONT></FONT><FONT size=2>::</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>OnDateTimeChanged</FONT></FONT><FONT size=2>(</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>NMHDR</FONT></FONT><FONT size=2> *</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>pNMHDR</FONT></FONT><FONT size=2>, </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>LRESULT</FONT></FONT><FONT size=2> *</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>pResult</FONT></FONT><FONT size=2>)</DIV><DIV>{</DIV><DIV>&nbsp;&nbsp;&nbsp; </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>LPNMDATETIMECHANGE</FONT></FONT><FONT size=2> </FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>pDTChange</FONT></FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>reinterpret_cast</FONT></FONT><FONT size=2>&lt;</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>LPNMDATETIMECHANGE</FONT></FONT><FONT size=2>&gt;(</FONT><FONT color=#010001 size=2><FONT color=#010001 size=2>pNMHDR</FONT></FONT><FONT size=2>);</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp;&nbsp; <FONT color=#010001><FONT color=#010001>m_lastDate</FONT></FONT> = <FONT color=#010001><FONT color=#010001>pDTChange</FONT></FONT>-&gt;<FONT color=#010001><FONT color=#010001>st</FONT></FONT>;</FONT></DIV><P><FONT size=2>&nbsp;&nbsp;&nbsp; *<FONT color=#010001><FONT color=#010001>pResult</FONT></FONT> = 0;</FONT></P><FONT size=2><FONT color=#0000ff><FONT color=#0000ff><DIV>&nbsp;&nbsp;&nbsp; return</FONT></FONT> <FONT color=#010001><FONT color=#010001>FALSE</FONT></FONT>; <FONT color=#008000><FONT color=#008000>// Let the parent handle the message as well!</DIV><DIV></FONT></FONT></FONT><FONT size=2>}</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>"<FONT color=#010001>m_lastDate" will always contain the latest selection, no matter if the checkbox was checked or not. Though, just in case, I only use this variable if GetTime() fails (which it does when unchecked). One must also be careful with calls to SetTime() since it cannot be overloaded.</FONT></FONT></DIV></DIV>]]>
   </description>
   <pubDate>Sat, 25 Jul 2009 02:38:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51306&amp;title=serialize-cdatetimectrl-state-impossible#51306</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : OK.  This is a simple way to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51240&amp;title=serialize-cdatetimectrl-state-impossible#51240</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 24 July 2009 at 1:29am<br /><br />OK. <DIV>This is a simple way to bypass "the coordinate of the checkbox cannot be safely determined"</DIV><DIV><FONT size=2><P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> i = 0; i &lt; 30; i++)</P><P>{</P><P></FONT><FONT color=#008000 size=2>//LPARAM lparam = MAKELPARAM(10, 15);</P></FONT><FONT size=2><P>LPARAM lparam = MAKELPARAM(i, 15);</P><P>m_DateTimeCtrl.SendMessage(WM_LBUTTONDOWN, NULL, lparam);</P><P>COleDateTime dt;</P><P>m_DateTimeCtrl.GetTime(dt);</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (dt.GetStatus() == COleDateTime::valid)</P><P>{</P><P>CString s; s.Format(_T(</FONT><FONT color=#a31515 size=2>"Valid with i =%d"</FONT><FONT size=2>), i);</P><P>AfxMessageBox(s);</P><P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P><P>}</P><P>}</P><DIV></DIV>i = 0 - bad, 1 - good</FONT></DIV>]]>
   </description>
   <pubDate>Fri, 24 Jul 2009 01:29:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51240&amp;title=serialize-cdatetimectrl-state-impossible#51240</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : Sorry, didn&amp;#039;t mean it that...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51239&amp;title=serialize-cdatetimectrl-state-impossible#51239</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 23 July 2009 at 11:04pm<br /><br />Sorry, didn't mean it that way :(<DIV>The problem is not your solution. The problem is that Microsoft implemented the control this way.<FONT size=2></DIV></FONT>]]>
   </description>
   <pubDate>Thu, 23 Jul 2009 23:04:32 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51239&amp;title=serialize-cdatetimectrl-state-impossible#51239</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : If somebody ask a question: &amp;#034;How...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51223&amp;title=serialize-cdatetimectrl-state-impossible#51223</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 23 July 2009 at 3:54pm<br /><br /><P>If somebody ask a question: "How do you set a valid time AND uncheck the control programmatically?"</P><DIV>&nbsp;and recive positive answer - last he can do in his comment&nbsp;- use term ugly or talk about safe way!?</DIV><DIV></DIV>]]>
   </description>
   <pubDate>Thu, 23 Jul 2009 15:54:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51223&amp;title=serialize-cdatetimectrl-state-impossible#51223</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? :   mdoubson wrote:As you know...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51188&amp;title=serialize-cdatetimectrl-state-impossible#51188</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 22 July 2009 at 4:45pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by mdoubson" alt="Originally posted by mdoubson" style="vertical-align: text-bottom;" /> <strong>mdoubson wrote:</strong><br /><br />As you know CDateTimeCtrl not&nbsp;allow to retrieve&nbsp;datetime value (visible on display) if unchecked. <DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>This is simple code to programmatically change mode without user click - after you can get value - and uncheck CDateTimeCtrl control back.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>LPARAM lparam = MAKELPARAM(10, 15);</FONT></DIV><DIV><FONT size=2>m_DateTimeCtrl.SendMessage(WM_LBUTTONDOWN, NULL, lparam);</FONT></DIV><DIV><FONT size=2>//Of course 10 (y) and 15 (x) is coordinates for standard case - normal font. Need to adjust for some custom setup like large font</DIV></FONT></td></tr></table> <DIV>&nbsp;</DIV><DIV>Sorry, missed that post. But still, the solution is quite ugly (not to mention that the coordinate of the checkbox cannot be safely determined).</DIV>]]>
   </description>
   <pubDate>Wed, 22 Jul 2009 16:45:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51188&amp;title=serialize-cdatetimectrl-state-impossible#51188</guid>
  </item> 
  <item>
   <title><![CDATA[Serialize CDateTimeCtrl state impossible? : Control will not answer you on...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51187&amp;title=serialize-cdatetimectrl-state-impossible#51187</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 14024<br /><strong>Posted:</strong> 22 July 2009 at 4:45pm<br /><br />Control will not answer you on your call but still keep previously set value on it's display. I demonstarted how to get it back!]]>
   </description>
   <pubDate>Wed, 22 Jul 2009 16:45:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14024&amp;PID=51187&amp;title=serialize-cdatetimectrl-state-impossible#51187</guid>
  </item> 
 </channel>
</rss>