<?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 : A usage questi&#111;n</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : A usage questi&#111;n]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 21 Apr 2026 17:56:38 +0000</pubDate>
  <lastBuildDate>Fri, 05 Aug 2005 23:30:21 +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=2650</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[A usage questi&#111;n : a lot of code will be not good....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=8019&amp;title=a-usage-question#8019</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 2650<br /><strong>Posted:</strong> 05 August 2005 at 11:30pm<br /><br /><P>a lot of code will be not good. Why you need executed all code each time? </P><P>For example If you need to fill ComboBox from Array of strings, add "if&nbsp;block" to check that size of array was changed:</P><P>&nbsp;</P><FONT color=#0000ff size=2><P>void</FONT><FONT size=2> CMainFrame::OnUpdateFileOpen(CCmdUI* pCmdUI) </P><P>{</P><P>CXTPControlComboBox* pControl = DYNAMIC_DOWNCAST(CXTPControlComboBox, CXTPControl::FromUI(pCmdUI));</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (pControl &amp;&amp; !pControl-&gt;HasFocus())</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (pControl-&gt;GetCount() != m_arrResources.GetSize())</P><P>{</P><P>pControl-&gt;ResetContent();</P><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; m_arrResources.GetSize(); i++)</P><P>{ </P><P>pControl-&gt;AddString(m_arrResources<em>.strLanguage);</P><P>}</P><P>}</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> nCurSel = -1;</P><P>CDocument* pDocument = GetActiveFrame()-&gt;GetActiveDocument();</P><P></P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (pDocument)</P><P>{</P><P>CString strPath = pDocument-&gt;GetPathName();</P><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; m_arrResources.GetSize(); i++)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_arrResources<em>.strPath == strPath)</P><P>{</P><P>nCurSel = i;</P><P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P><P>} </P><P>}</P><P>}</P><P>pControl-&gt;SetCurSel(nCurSel);</P><P>} </P><P>}</P></FONT>]]>
   </description>
   <pubDate>Fri, 05 Aug 2005 23:30:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=8019&amp;title=a-usage-question#8019</guid>
  </item> 
  <item>
   <title><![CDATA[A usage questi&#111;n : Will there be any performance...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=8008&amp;title=a-usage-question#8008</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=797">jeffcmj</a><br /><strong>Subject:</strong> 2650<br /><strong>Posted:</strong> 04 August 2005 at 7:46pm<br /><br />Will there be any performance reduce if I put a lot of code in UpdateUI handler? Since this function is called very often.]]>
   </description>
   <pubDate>Thu, 04 Aug 2005 19:46:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=8008&amp;title=a-usage-question#8008</guid>
  </item> 
  <item>
   <title><![CDATA[A usage questi&#111;n : You can call any function in Update...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=7918&amp;title=a-usage-question#7918</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 2650<br /><strong>Posted:</strong> 28 July 2005 at 11:45pm<br /><br /><P>You can call any function in Update handler:</P><P>&nbsp;</P><P>void CMainFrame::OnUpdateEditState(CCmdUI* pCmdUI)<BR>{<BR>&nbsp;CMaxAddressCB* pStateCombo = DYNAMIC_DOWNCAST(CMaxAddressCB, CXTPControl::FromUI(pCmdUI));</P><P>&nbsp;if (pStateCombo &amp;&amp; !pStateCombo-&gt;HasFocus())<BR>&nbsp;{<BR>&nbsp;&nbsp;pStateCombo-&gt;SetDefaultText("New text")</P><P>&nbsp;}</P><P>&nbsp;pCmdUI-&gt;Enable(TRUE);<BR>}<BR></P>]]>
   </description>
   <pubDate>Thu, 28 Jul 2005 23:45:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=7918&amp;title=a-usage-question#7918</guid>
  </item> 
  <item>
   <title><![CDATA[A usage questi&#111;n : But in my case it not only updating...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=7916&amp;title=a-usage-question#7916</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=797">jeffcmj</a><br /><strong>Subject:</strong> 2650<br /><strong>Posted:</strong> 28 July 2005 at 9:56pm<br /><br />But in my case it not only updating the text?&nbsp; I&nbsp;want to&nbsp;call some functions in my derived control.]]>
   </description>
   <pubDate>Thu, 28 Jul 2005 21:56:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=7916&amp;title=a-usage-question#7916</guid>
  </item> 
  <item>
   <title><![CDATA[A usage questi&#111;n : It is bad design to use saved...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=7912&amp;title=a-usage-question#7912</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 2650<br /><strong>Posted:</strong> 28 July 2005 at 12:59pm<br /><br /><P>It is bad design to use saved pointer. You right - user can remove this control or copuit to another toolbar.</P><P>&nbsp;</P><P>So solution 1 (bad)</P><P>to find pointer each time you need to set/get text:</P><P>CXTPControlComboBox* GetAddressCombo()<BR>{<BR>&nbsp; return (CXTPControlComboBox*)  GetMainFrame()-&gt;GetCommandBars()-&gt;FindControl(xtpContr olComboBox, ID_GOTO_URL, FALSE, FALSE);<BR>}<BR></P><P>solution 2 (good)</P><P>Update text in Update Handler (see any sample with combobox)</P><P>as result if user copy it to another toolbar, they both will be updated.</P>]]>
   </description>
   <pubDate>Thu, 28 Jul 2005 12:59:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=7912&amp;title=a-usage-question#7912</guid>
  </item> 
  <item>
   <title><![CDATA[A usage questi&#111;n : Hi, I have a customized Combobox...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=7895&amp;title=a-usage-question#7895</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=797">jeffcmj</a><br /><strong>Subject:</strong> 2650<br /><strong>Posted:</strong> 28 July 2005 at 1:37am<br /><br /><P>Hi,</P><P>I have a customized Combobox in my program which is derived in XTP's combobox. And I have the following code:</P><P>int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)<BR>{...<BR>if(nID==ID_ADDRESSBOX)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;CMaxAddressCB* pButton = (CMaxAddressCB*)CMaxAddressCB::CreateObject();<BR>&nbsp;&nbsp;&nbsp;pButton-&gt;SetFlags(xtpFlagManualUpdate);<BR>&nbsp;&nbsp;&nbsp;pButton-&gt;SetIconId(ID_ADDRESSBOX);<BR>&nbsp;&nbsp;&nbsp;pButton-&gt;SetDropDownListStyle();<BR>&nbsp;&nbsp;&nbsp;pButton-&gt;SetDefaultText(_T("Input URL here"));<BR>&nbsp;&nbsp;&nbsp;pButton-&gt;SetCaption(_T("Address"));<BR>&nbsp;&nbsp;&nbsp;pButton-&gt;SetWidth(400);<BR>&nbsp;&nbsp;&nbsp;pButton-&gt;SetAutoComplete(0x0e);<BR>&nbsp;&nbsp;&nbsp;lpCreateControl-&gt;pControl = pButton;<BR>&nbsp;&nbsp;&nbsp;m_pAddressCB = pButton;<BR>&nbsp;&nbsp;&nbsp;return TRUE;<BR>&nbsp;&nbsp;}<BR>...<BR>}</P><P>You see I use m_pAddressCB to hold the pointer to my control. It worked most of the time. But, if I go into the customization mode and customized the combobox(eg, drag it a bit longer), then next time when I start my program, I found the m_pAddressCB does not point to the real combobox used in the problem. I think it's because of the LoadCommandBar function of XTP but I don't know what's the best way to avoid it. </P><P>Please advise.</P><P>Thanks</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Thu, 28 Jul 2005 01:37:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2650&amp;PID=7895&amp;title=a-usage-question#7895</guid>
  </item> 
 </channel>
</rss>