<?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 : Saving CXTPControlComboBox items</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Saving CXTPControlComboBox items]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 22 May 2026 06:52:16 +0000</pubDate>
  <lastBuildDate>Wed, 04 Apr 2007 18:29:30 +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=6802</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[Saving CXTPControlComboBox items :  How can I persist a dynamic...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=6802&amp;PID=21690&amp;title=saving-cxtpcontrolcombobox-items#21690</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1227">esc67</a><br /><strong>Subject:</strong> 6802<br /><strong>Posted:</strong> 04 April 2007 at 6:29pm<br /><br /><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>How can I persist a dynamic list of items for a CXTPControlComboBox that is inside a command bar?</FONT></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>I create a CXTPControlComboBox in CMainFrame::OnCreateControl in order to have a “command entry” box in a toolbox:</FONT></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">CXTPControlComboBox* pCommandComboBox = (CXTPControlComboBox*)CXTPControlComboBox::CreateObject();<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">pCommandComboBox-&gt;SetDropDownListStyle(TRUE);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">pCommandComboBox-&gt;SetCaption(_T(<SPAN style="COLOR: #a31515">"Command &gt;"</SPAN>));<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">pCommandComboBox-&gt;SetStyle(xtpComboLabel);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">pCommandComboBox-&gt;SetFlags(xtpFlagControlStretched);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">lpCreateControl-&gt;pControl = pCommandComboBox;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>Each time the user types text in the textbox I add the string to the combobox list by calling InsertString.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>This gives the user a list of recently used commands.</FONT></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3>The problem is that the list of strings in the combobox are not persisted when the application quits. Apparently calling DoPropExchange on GetCommandBars() doesn’t work, so I tried saving and loading the items in my own file. However, the items get erased sometime after OnCreateControl is called.</FONT></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P>]]>
   </description>
   <pubDate>Wed, 04 Apr 2007 18:29:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=6802&amp;PID=21690&amp;title=saving-cxtpcontrolcombobox-items#21690</guid>
  </item> 
 </channel>
</rss>