<?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 : CXTPButton::SetChecked / CWnd::UpdateData problems</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTPButton::SetChecked / CWnd::UpdateData problems]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 15 Apr 2026 03:51:26 +0000</pubDate>
  <lastBuildDate>Wed, 14 Aug 2019 17:41:45 +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=23888</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[CXTPButton::SetChecked / CWnd::UpdateData problems : You have run into the problem...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23888&amp;PID=77442&amp;title=cxtpbuttonsetchecked-cwndupdatedata-problems#77442</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9155">BobC</a><br /><strong>Subject:</strong> 23888<br /><strong>Posted:</strong> 14 August 2019 at 5:41pm<br /><br />You have run into the problem of UpdateData() being an all-or-nothing function, and because of that, I prefer to not use it at all except for trivially simple dialogs where all I want is to load values in OnInitDialog and retrieve values in OnOK.<div><br></div><div>Most dialogs I construct are not that simple, so OnInitDialog initializes them all with specific calls such as SetWindowText, SetCheck, etc., and the OnOK handler uses GetWindowText, GetCheck, etc. to validate the values, and only allows OnOK to succeed if all validation succeeds.</div><div><br></div><div>You can see some recent dialogs at <a href="https://drive.google.com/drive/folders/1tRI0MIsoCT2sU5oeKFNgpx3cLgzDNw4M" target="_blank" rel="nofollow">https://drive.google.com/drive/folders/1tRI0MIsoCT2sU5oeKFNgpx3cLgzDNw4M</a> . The dialogs are the screens without the button toolbar (but technically, they are all dialogs because the application is form-based).<br><div><br></div><div>It sounds like you don't need to, and probably cannot, update all values at once, and if that is the case, you should not be using UpdateData().</div></div>]]>
   </description>
   <pubDate>Wed, 14 Aug 2019 17:41:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23888&amp;PID=77442&amp;title=cxtpbuttonsetchecked-cwndupdatedata-problems#77442</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPButton::SetChecked / CWnd::UpdateData problems : I have a button on a dialog which,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=23888&amp;PID=77439&amp;title=cxtpbuttonsetchecked-cwndupdatedata-problems#77439</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9367">liong</a><br /><strong>Subject:</strong> 23888<br /><strong>Posted:</strong> 13 August 2019 at 11:21am<br /><br />I have a button on a dialog which, when pressed, executes the following code to set the checked state of another button.<div>With V15.0.2 this was working fine but now the same implementation causes problems with V17.0.0.</div><div><br></div><div><div><font face="Courier New, Courier, mono">void MyDialog::OnBnClickedA()</font></div><div><font face="Courier New, Courier, mono">{</font></div><div><font face="Courier New, Courier, mono">&nbsp; m_BtnB.SetChecked(FALSE);</font></div><div><font face="Courier New, Courier, mono">&nbsp; UpdateData(FALSE); // will call CWnd::UpdateData</font></div><div><font face="Courier New, Courier, mono">}</font></div></div><div><br></div><div>I found out that UpdateData which does the data exchange sends a BM_SETCHECK msg which is handled by CXTPButton::OnSetCheck. This handler wasn't there in V15.0.2 but is now in V17.0.0.</div><div>Amongst other things, this one calls</div><div><br></div><div><div><font face="Courier New, Courier, mono">&nbsp; if (IsPushButton())</font></div><div><font face="Courier New, Courier, mono">&nbsp; {</font></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp; SetChecked(!GetChecked());</font></div><div><font face="Courier New, Courier, mono">&nbsp; }</font></div></div><div><br></div><div>to toggle the check state again :/</div><div><br></div><div>I cannot remove the call to UpdateData since this is needed for other controls.</div><div><br></div><div>How can i set the checked state for a CXTPButton in such a constellation?</div><div><br></div>]]>
   </description>
   <pubDate>Tue, 13 Aug 2019 11:21:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=23888&amp;PID=77439&amp;title=cxtpbuttonsetchecked-cwndupdatedata-problems#77439</guid>
  </item> 
 </channel>
</rss>