<?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 : Control identifier</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Control identifier]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 17:29:18 +0000</pubDate>
  <lastBuildDate>Thu, 14 May 2009 03:35:38 +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=14287</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[Control identifier : Hi,Sorry forgot to remove this...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48973&amp;title=control-identifier#48973</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 14287<br /><strong>Posted:</strong> 14 May 2009 at 3:35am<br /><br />Hi,<br><br>Sorry forgot to remove this lines.<br>Because i copy some part from our application.<br><br>&nbsp; Jimmy<br><br>]]>
   </description>
   <pubDate>Thu, 14 May 2009 03:35:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48973&amp;title=control-identifier#48973</guid>
  </item> 
  <item>
   <title><![CDATA[Control identifier : (Jimmy - sorry for misspelling...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48957&amp;title=control-identifier#48957</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5078">Bart6</a><br /><strong>Subject:</strong> 14287<br /><strong>Posted:</strong> 13 May 2009 at 3:22pm<br /><br />(Jimmy - sorry for misspelling your name)<br />(I commented m_dwMenuLock & ML_ANY)<br /><br />I got this to work:<br /><br /><font face="Courier New, Courier, mono">//---------------------------------------------------------------------------<br />//<br />//---------------------------------------------------------------------------<br />//<br />void<br />CPyroView::OnCamera(NMHDR *pNMHDR,LRESULT *pResult)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CXTPControl *pControl = ((NMXTPCONTROL *)pNMHDR)-&gt;pControl;<br />&nbsp;&nbsp;&nbsp;&nbsp;if (pControl)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ICamera* camera = (ICamera*)pControl-&gt;GetTag();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(camera);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;camera-&gt;Activate();<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br />//---------------------------------------------------------------------------<br />//<br />//---------------------------------------------------------------------------<br />//<br />CXTPControl* CPyroView::GetControl(CCmdUI *pCmdUI)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if (!pCmdUI-&gt;m_pOther)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br />&nbsp;&nbsp;&nbsp;&nbsp;return ((CXTPCommandBar*)pCmdUI-&gt;m_pOther)-&gt;GetControl(pCmdUI-&gt;m_nIndex);<br />}<br /><br />//---------------------------------------------------------------------------<br />//<br />//---------------------------------------------------------------------------<br />//<br />void CPyroView::OnUpdateCamera(CCmdUI *pCmdUI)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;//if (m_dwMenuLock & ML_ANY)<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;pCmdUI-&gt;Enable(FALSE);<br />&nbsp;&nbsp;&nbsp;&nbsp;//else<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPControl* pControl = GetControl(pCmdUI);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pControl)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ICamera* camera = (ICamera*) pControl-&gt;GetTag();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ASSERT(camera);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pCmdUI-&gt;SetCheck(camera-&gt;IsActive());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pCmdUI-&gt;Enable(camera != NULL);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pCmdUI-&gt;Enable(FALSE);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></font><br /><br />Thanks!<br />Bart]]>
   </description>
   <pubDate>Wed, 13 May 2009 15:22:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48957&amp;title=control-identifier#48957</guid>
  </item> 
  <item>
   <title><![CDATA[Control identifier : Thank you Kimmy - i&amp;#039;m trying...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48956&amp;title=control-identifier#48956</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5078">Bart6</a><br /><strong>Subject:</strong> 14287<br /><strong>Posted:</strong> 13 May 2009 at 3:15pm<br /><br />Thank you Kimmy - i'm trying the latter, but bump into undefined "m_dwMenuLock" & "ML_ANY". I searched the library, but could find any reference to it.<br /><br />Will the last proposal also be capable of checking the active camera? (only active camera is checked, the other arent)<br /><br />Thanks again for looking inito this<br />Bart]]>
   </description>
   <pubDate>Wed, 13 May 2009 15:15:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48956&amp;title=control-identifier#48956</guid>
  </item> 
  <item>
   <title><![CDATA[Control identifier : Also can useCXTPControl *CPyroView::GetControl(CCmdUI...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48955&amp;title=control-identifier#48955</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 14287<br /><strong>Posted:</strong> 13 May 2009 at 2:36pm<br /><br />Also can use<br><br>CXTPControl *CPyroView::GetControl(CCmdUI *pCmdUI)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; if (!pCmdUI-&gt;m_pOther)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;<br>&nbsp;&nbsp;&nbsp; return ((CXTPCommandBar*)pCmdUI-&gt;m_pOther)-&gt;GetControl(pCmdUI-&gt;m_nIndex);<br>&nbsp;&nbsp;&nbsp; }<br><br>void CPyroView::OnUpdateCamera(CCmdUI *pCmdUI)<br>{<br>&nbsp;&nbsp;&nbsp; if (m_dwMenuLock &amp; ML_ANY)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pCmdUI-&gt;Enable(FALSE);<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPControl* pControl = GetControl(pCmdUI);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pControl)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ICamera* camera = (ICamera*) pControl-&gt;GetTag();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pCmdUI-&gt;SetCheck( (camera-&gt;Active()) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pCmdUI-&gt;Enable(FALSE);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br>&nbsp; Jimmy<br><br>]]>
   </description>
   <pubDate>Wed, 13 May 2009 14:36:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48955&amp;title=control-identifier#48955</guid>
  </item> 
  <item>
   <title><![CDATA[Control identifier : OrpCameraItem-&amp;gt;SetTag( (DWORD_PTR)...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48954&amp;title=control-identifier#48954</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 14287<br /><strong>Posted:</strong> 13 May 2009 at 2:32pm<br /><br />Or<br>pCameraItem-&gt;SetTag(&nbsp; (DWORD_PTR) <font face="Courier New, Courier, mono">camera</font> );<br><br><font face="Courier New, Courier, mono">ICamera* camera</font> = (<font face="Courier New, Courier, mono">ICamera*) </font>pControl-&gt;GetTag();<br><br>&nbsp; Jimmy<br><br>]]>
   </description>
   <pubDate>Wed, 13 May 2009 14:32:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48954&amp;title=control-identifier#48954</guid>
  </item> 
  <item>
   <title><![CDATA[Control identifier : Hi,Add pCameraItem-&amp;gt;SetTag(...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48953&amp;title=control-identifier#48953</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 14287<br /><strong>Posted:</strong> 13 May 2009 at 1:43pm<br /><br />Hi,<br><br>Add<br>&nbsp; pCameraItem-&gt;SetTag( iIndex)<br><br>Remove ON_COMMAND and insert this line<br>ON_XTP_EXECUTE(ID_FILE_RECENTPROJECTS, OnCamera)<br><br>void CPyroView::OnCamera(NMHDR *pNMHDR,LRESULT *pResult)<br>{<br>&nbsp;&nbsp;&nbsp; CXTPControl *pControl = ((NMXTPCONTROL *)pNMHDR)-&gt;pControl;<br>&nbsp;&nbsp;&nbsp; if (pControl)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DWORD_PTR myIndex = pControl-&gt;GetTag();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // do yours<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><br>&nbsp; Jimmy<br><br>]]>
   </description>
   <pubDate>Wed, 13 May 2009 13:43:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48953&amp;title=control-identifier#48953</guid>
  </item> 
  <item>
   <title><![CDATA[Control identifier : Hi all,  My application used a...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48945&amp;title=control-identifier#48945</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5078">Bart6</a><br /><strong>Subject:</strong> 14287<br /><strong>Posted:</strong> 13 May 2009 at 10:50am<br /><br />Hi all,<br /><br />My application used a user-defined number of cameras (minimum 1). The user can pick from a commandbar the active camera.<br /><br />To populate the commandbar, i use:<br /><br /><font face="Courier New, Courier, mono">BOOST_FOREACH(ICamera* camera, cameras-&gt;Collection()) {<br />&nbsp;&nbsp;&nbsp;CXTPControl* pCameraItem = pControls-&gt;Add(xtpControlButton, ID_CAMERA);<br />&nbsp;&nbsp;&nbsp;pCameraItem-&gt;SetCaption( camera-&gt;Name().c_str() );<br />&nbsp;&nbsp;&nbsp;pCameraItem-&gt;SetChecked( camera == cameras-&gt;Active() ); <br />}</font><br /><br />The listen to the commands, i use:<br /><br /><font face="Courier New, Courier, mono">ON_COMMAND(ID_CAMERA, OnCamera)</font><br /><br />and <br /><br /><font face="Courier New, Courier, mono">void CPyroView::OnCamera()<br />{<br />&nbsp;&nbsp;&nbsp;// what camera is being picked?<br />}<br /></font><br /><br />Question: all the controls in the commandbar have the same id (ID_CAMERA) - in OnCamera i can't make the distinction between what camera is picked.<br />What is the correct method to use, when the amount of camera's is unknown (iow ON_COMMAND_RANGE cant be used)<br /><br />Thanks<br />Bart]]>
   </description>
   <pubDate>Wed, 13 May 2009 10:50:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14287&amp;PID=48945&amp;title=control-identifier#48945</guid>
  </item> 
 </channel>
</rss>