<?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 : How to properly enable a ribbon edit control</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : How to properly enable a ribbon edit control]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 13 Jun 2026 14:40:50 +0000</pubDate>
  <lastBuildDate>Wed, 16 Mar 2011 04:45:58 +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=17891</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[How to properly enable a ribbon edit control : thanks for sharing, will hold...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=63336&amp;title=how-to-properly-enable-a-ribbon-edit-control#63336</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 16 March 2011 at 4:45am<br /><br />thanks for sharing, will hold in mind this feature.]]>
   </description>
   <pubDate>Wed, 16 Mar 2011 04:45:58 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=63336&amp;title=how-to-properly-enable-a-ribbon-edit-control#63336</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : Oleg,  Microsoft finally got...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=63324&amp;title=how-to-properly-enable-a-ribbon-edit-control#63324</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 15 March 2011 at 9:24am<br /><br />Oleg,<DIV>&nbsp;</DIV><DIV>Microsoft finally got back to me. This is an intended change we have to live with:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><P style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #333333; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'">Hi RD – I found that this was indeed a by-design change to improve managed native interop scenarios.<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #333333; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'">I’m told there is a TRACE statement in CWnd::Create which attempts to alert you of the problem.&nbsp; Now, with this change, any dialog control must have an ID other than zero in order for GetDlgItem to work correctly.<o:p></o:p></SPAN></P><P style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #333333; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></SPAN></P><P style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Times New Roman','serif'; COLOR: #333333; FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'">I hope that helps.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>I’m requesting the forum post be updated with more information.<o:p></o:p></SPAN></P></DIV>]]>
   </description>
   <pubDate>Tue, 15 Mar 2011 09:24:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=63324&amp;title=how-to-properly-enable-a-ribbon-edit-control#63324</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : Thanks Oleg.  I went to the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62718&amp;title=how-to-properly-enable-a-ribbon-edit-control#62718</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 16 February 2011 at 3:30pm<br /><br />Thanks Oleg.<DIV>&nbsp;</DIV><DIV>I went to the MS connect article. The original complaint was "rejected" because MS could not duplicate it! I added my two cents worth.</DIV><DIV>&nbsp;</DIV><DIV>I also opened a support case with Microsoft since&nbsp;I rarely get any satisfaction with "connect".</DIV>]]>
   </description>
   <pubDate>Wed, 16 Feb 2011 15:30:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62718&amp;title=how-to-properly-enable-a-ribbon-edit-control#62718</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : Hi,Yes, we are preparing 15.0.2...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62713&amp;title=how-to-properly-enable-a-ribbon-edit-control#62713</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 16 February 2011 at 2:17pm<br /><br />Hi,<div><br></div><div>Yes, we are preparing 15.0.2 with collection of small fixes.</div>]]>
   </description>
   <pubDate>Wed, 16 Feb 2011 14:17:39 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62713&amp;title=how-to-properly-enable-a-ribbon-edit-control#62713</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : :)Actually just found some complains...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62712&amp;title=how-to-properly-enable-a-ribbon-edit-control#62712</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 16 February 2011 at 2:16pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">:)<div><br></div><div>Actually just found some complains about this new "feature".</div><div><br></div><div><a href="http://c&#111;nnect.microsoft.com/VisualStudio/feedback/details/632178/cwnd-precreatewindow-change-causing-problems" target="_blank">http://connect.microsoft.com/VisualStudio/feedback/details/632178/cwnd-precreatewindow-change-causing-problems</a></div><div><br></div><div>Don't see any reason why Microsoft added it</div></div>]]>
   </description>
   <pubDate>Wed, 16 Feb 2011 14:16:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62712&amp;title=how-to-properly-enable-a-ribbon-edit-control#62712</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : Oleg,  I made the following...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62709&amp;title=how-to-properly-enable-a-ribbon-edit-control#62709</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 16 February 2011 at 1:47pm<br /><br />Oleg,<DIV>&nbsp;</DIV><DIV>I made the following quick-and-dirty change as suggested. Works like a charm. Thanks for the quick reply. Will you have something in an update anytime soon?</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>BOOL CXTPCommandBarEditCtrl::CreateEdit(DWORD dwStyle, CWnd* pParentWnd)</P><P>{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (GetRichEditContext().m_hInstance)</P><P>{</P><P>BOOL bResult = CWnd::Create(GetRichEditContext().m_strClassName, 0, dwStyle, CRect(0, 0, 0, 0), pParentWnd, 0);</P><P>SendMessage(EM_SETEVENTMASK, 0, ENM_CHANGE);</P><P>SendMessage(EM_SETTEXTMODE, TM_PLAINTEXT | TM_SINGLELEVELUNDO);</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>( bResult ) SetDlgCtrlID(0);</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> bResult;</P><P>}</P><P>BOOL bRet = Create(dwStyle, CRect(0, 0, 0, 0), pParentWnd, 0);</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>( bRet )</P><P>{</P><P>SetDlgCtrlID(0);</P><P>}</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> bRet;</P><P>}</P></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 16 Feb 2011 13:47:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62709&amp;title=how-to-properly-enable-a-ribbon-edit-control#62709</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : I&amp;#039;ll give that a shot. I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62699&amp;title=how-to-properly-enable-a-ribbon-edit-control#62699</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 16 February 2011 at 10:02am<br /><br />I'll give that a shot. I don't see why it would not work. I thought I could get the underlying edit control from the CXTPControlEdit after we create the latter. But I see the CEdit is created well after we create the CJ control. So a code change in CJ makes more sense.<DIV>&nbsp;</DIV><DIV>This is odd though. I have just stepped thru all the code where you create the "RichEdit20W" control. I get to CWnd::Create and there I see the nID passed in is used to init the hMenu of the create struct passed to PreCreateWindow.</DIV><DIV>&nbsp;</DIV><DIV>Sure enough Microsoft has changed the code in PrecreateWindow where they added this:</DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas></FONT></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> ((cs.hMenu == NULL) &amp;&amp; (cs.style &amp; WS_CHILD))</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>{</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>cs.hMenu = (HMENU)(UINT_PTR)</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>this</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>}</FONT></FONT></DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&nbsp;</DIV><DIV></DIV>This explains what I saw in OnCmdMsg. The ID looked like a pointer and now I see it is. I think I'll ping Microsoft on this and ask why they made the change.<DIV></DIV><DIV>&nbsp;</DIV><DIV>Also we happen to disable unknown IDs when they come thru our OnCmdMsg (we have a reason ...). So until we moved to VS 2010, we didn't have this problem. We also moved to a new CJ so we didn't know what the root cause of the disabled controls was.</DIV><DIV>&nbsp;</DIV><DIV>Friend said MS "broke CodeJock" on purpose!</DIV></FONT></FONT>]]>
   </description>
   <pubDate>Wed, 16 Feb 2011 10:02:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62699&amp;title=how-to-properly-enable-a-ribbon-edit-control#62699</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : Just to be sure it will work for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62685&amp;title=how-to-properly-enable-a-ribbon-edit-control#62685</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 16 February 2011 at 2:09am<br /><br />Just to be sure it will work for you, please in&nbsp;<div>BOOL CXTPCommandBarEditCtrl::CreateEdit(DWORD dwStyle, CWnd* pParentWnd)</div><div>add line</div><div><div><span ="Apple-tab-span" style="white-space:pre">		</span>SetDlgCtrlID(0);</div></div><div>and build toolkit. &nbsp;Its fixed problem ?</div><div><br></div>]]>
   </description>
   <pubDate>Wed, 16 Feb 2011 02:09:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62685&amp;title=how-to-properly-enable-a-ribbon-edit-control#62685</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : Hello,Thanks a lot for such detailed...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62684&amp;title=how-to-properly-enable-a-ribbon-edit-control#62684</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 16 February 2011 at 1:58am<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Hello,<div><br></div><div>Thanks a lot for such detailed description.</div><div>I guess its about Visual Studio 2010 ? &nbsp; It has very strange feature (I'd call it even bug) - if we create window with Create method and parameter nID = 0, only Visual Studio 2010 assign some non zero ID instead of 0.</div><div><br></div><div>// Weird VC2010 only code:</div><div>{</div><div><div><br></div><div><span ="Apple-tab-span" style="white-space: pre; ">	</span>if ((cs.hMenu == NULL) &amp;&amp; (cs.style &amp; WS_CHILD))</div><div><span ="Apple-tab-span" style="white-space: pre; ">	</span>{</div><div><span ="Apple-tab-span" style="white-space: pre; ">		</span>cs.hMenu = (HMENU)(UINT_PTR)this;</div><div><span ="Apple-tab-span" style="white-space: pre; ">	</span>}</div>}</div><div><br></div><div><br></div><div>I will check all such places in CommandBars and set Windows ID to zero after Create.</div><div><br></div><div>Thanks for help.</div></div>]]>
   </description>
   <pubDate>Wed, 16 Feb 2011 01:58:58 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62684&amp;title=how-to-properly-enable-a-ribbon-edit-control#62684</guid>
  </item> 
  <item>
   <title><![CDATA[How to properly enable a ribbon edit control : We have added a CXTPControlEdit...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62679&amp;title=how-to-properly-enable-a-ribbon-edit-control#62679</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 17891<br /><strong>Posted:</strong> 15 February 2011 at 6:27pm<br /><br />We have added a CXTPControlEdit to our ribbon. We set the control ID and in our OnCmdMsg handler we set the enable flag on the cmd UI object to TRUE. But we find our control is disabled.<DIV>&nbsp;</DIV><DIV>After debugging I found that the command bars object calls UpdateDialogControls. While walking the child windows the code finds the edit control created by the CXTPEditControl (the m_pEdit member that is the actual windows edit control). Then the routine calls GetDlgCtrlID and sets that in a cmd UI object and calls OnCmdMsg.</DIV><DIV>&nbsp;</DIV><DIV>Our OnCmdMsg simply sees the "m_pOther" object as a generic CWnd and of course the ID passed in is unknown to us (we disable any unknown IDs by default). Hence I have no real way to determine what I have and whether it should be enabled or not.</DIV><DIV>&nbsp;</DIV><DIV><DIV>So I am wondering what is the best way to handle controls/windows on the ribbon for update UI purposes. After creating the CXTPControlEdit object should we get the m_pEdit member and call SetDlgCtrlID to something we would recognize (probably the same value we set on the CXTPControlEdit object)? It looks like I can set the control ID to zero too.</DIV><DIV>&nbsp;</DIV><DIV>Or is there some other method I have overlooked that lets us talk to the generic CXTPControl class where I can set the dialog control ID of the underlying object? Something else I should do?</DIV></DIV>]]>
   </description>
   <pubDate>Tue, 15 Feb 2011 18:27:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=17891&amp;PID=62679&amp;title=how-to-properly-enable-a-ribbon-edit-control#62679</guid>
  </item> 
 </channel>
</rss>