<?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 : CXTPDialogBar Messages</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : CXTPDialogBar Messages]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 14:46:10 +0000</pubDate>
  <lastBuildDate>Wed, 01 Sep 2010 00:51:43 +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=17103</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[CXTPDialogBar Messages : Thank you for your comments, znakeeye!...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17103&amp;PID=59990&amp;title=cxtpdialogbar-messages#59990</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5902">CyberSky</a><br /><strong>Subject:</strong> 17103<br /><strong>Posted:</strong> 01 September 2010 at 12:51am<br /><br />Thank you for your comments, znakeeye! I'm sorry it's taken so long to get back to you.<DIV>&nbsp;</DIV><DIV>To be clear: I had message handlers in my view class for menu commands and toolbar buttons. When&nbsp;I used the MFC dialog bar, I found that if I gave a control (a button) the same resource ID as a menu command or toolbar button, I could click the menu command, the tollbar button, or the button in the dialog bar and have the same code (the message handler in my view) do whatever needed to be done.</DIV><DIV>&nbsp;</DIV><DIV>When I switched to the CodeJock CXTPDialogBar, this stopped working. I wanted to quickly find a way to get things working again, and they do. I'd like to do things in a better way, if possible. However, I tried your code an nothing happens. I click the button in the dialog bar and the handler in my view class doesn't get the message. I'm not sure how it would...</DIV><DIV>&nbsp;</DIV><DIV>I'm obviously not an expert in command routing. Any more pointers on what I can try? Do you know if one of the CodeJock examples shows the correct way to do this?</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 01 Sep 2010 00:51:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17103&amp;PID=59990&amp;title=cxtpdialogbar-messages#59990</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPDialogBar Messages : Microsoft didn&amp;#039;t document...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17103&amp;PID=59865&amp;title=cxtpdialogbar-messages#59865</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 17103<br /><strong>Posted:</strong> 22 August 2010 at 8:49am<br /><br /><P>Microsoft didn't document this well. Due to that, you find a lot of bad hacks out there. Like the one proposed.</P><DIV>If a WM_COMMAND message does not arrive to its destination, it is due to an erroneous message handler: <strong>CWnd::OnCmdMsg</strong>. If the main-window does not route messages to the CXTPDialogBar, then you cannot expect it to receive them. WM_COMMAND is propagated from top to bottom, so you should NEVER send it to a window's parent window! Doing so might hang your application if some other programmer, later on,&nbsp;implements command routing logic&nbsp;the <U>right</U> way:</DIV><DIV>&nbsp;</DIV><DIV>BOOL CMainWnd::OnCmdMsg(...)</DIV><DIV>{</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp; if (m_wndDialogBar.OnCmdMsg(...))</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return TRUE;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp; return CFrameWnd::OnCmdMsg(...);</DIV><DIV>}</DIV><DIV>&nbsp;</DIV><DIV>This is of course a very simple example. Usually you have to consider focus, active pane/view and stuff. The reason why CDialog worked out of the box, is that MFC does a lot of nasty things behind your back :)</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Note: If you <strong>must </strong>send a WM_COMMAND message, then always send it to the <strong>top-level </strong>parent, usually AfxGetMainWnd().</DIV>]]>
   </description>
   <pubDate>Sun, 22 Aug 2010 08:49:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17103&amp;PID=59865&amp;title=cxtpdialogbar-messages#59865</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPDialogBar Messages : My program&amp;#039;s view used to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17103&amp;PID=59863&amp;title=cxtpdialogbar-messages#59863</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5902">CyberSky</a><br /><strong>Subject:</strong> 17103<br /><strong>Posted:</strong> 21 August 2010 at 1:23pm<br /><br /><FONT face="Verdana, Arial, Helvetica, sans-serif">My program's view used to get messages from the MFC dialog bar without any extra work. Then I switched to&nbsp;CXTPDialogBar and that broke. The way I dealt with this is to add handlers for the controls in my dialog bar class and to send the messages to my view:</FONT><DIV><FONT color=#0000ff size=3><FONT color=#0000ff size=3></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff><FONT color=#0000ff size=2 face="Courier New, Courier, mono">void CControlDlg::OnBnClickedFoo()<BR>{<BR>&nbsp;&nbsp;&nbsp; CMyProgramView::View()-&gt;SendMessage(WM_COMMAND, IDC_FOO, NULL);<BR>}</FONT></FONT></DIV><DIV><FONT color=#0000ff size=2 face="Courier New"></FONT>&nbsp;</DIV><DIV><FONT size=2 face="Verdana, Arial, Helvetica, sans-serif">I don't know if this is the best way, but it works.</FONT></DIV><DIV><FONT size=2 face="Courier New"></FONT>&nbsp;</DIV><DIV><FONT size=2 face="Verdana, Arial, Helvetica, sans-serif">You should also be aware that if the&nbsp;CodeJock dialog has the focus you can't press Alt+F to access the File menu, etc. You need to override PreTranslateMessage() in your CXTPDialogBar-derived class and add the code from the MFC dialog bar class.</FONT></DIV><DIV><FONT size=2 face="Courier New"></FONT>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sat, 21 Aug 2010 13:23:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17103&amp;PID=59863&amp;title=cxtpdialogbar-messages#59863</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPDialogBar Messages : Hi,  is there a sample available...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17103&amp;PID=59753&amp;title=cxtpdialogbar-messages#59753</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3512">Ocrana</a><br /><strong>Subject:</strong> 17103<br /><strong>Posted:</strong> 11 August 2010 at 8:57pm<br /><br />Hi,<br /><br />is there a sample available where I can see how to receive messages from a CXTPDialogBar. I use a CXTPDialogBar with some buttons as a special ToolBar. But I have now Idea how to receive the Messages (Button click) in the main form.<br />So I want to see or get help how to communicate with the CXTPDialogBar.<br /><br />Thanks,<br /><br />Ocrana]]>
   </description>
   <pubDate>Wed, 11 Aug 2010 20:57:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17103&amp;PID=59753&amp;title=cxtpdialogbar-messages#59753</guid>
  </item> 
 </channel>
</rss>