<?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 : Bug in CXTPTabClientWnd::UpdateContents().</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Bug in CXTPTabClientWnd::UpdateContents().]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 10 Jun 2026 07:57:46 +0000</pubDate>
  <lastBuildDate>Mon, 19 Jun 2006 08:57:49 +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=4434</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[Bug in CXTPTabClientWnd::UpdateContents(). : I think you have a bug in method: void...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=4434&amp;PID=13707&amp;title=bug-in-cxtptabclientwndupdatecontents#13707</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=828">Sergey</a><br /><strong>Subject:</strong> 4434<br /><strong>Posted:</strong> 19 June 2006 at 8:57am<br /><br />I think you have a bug in method:<FONT color=#0000ff size=3><P><FONT size=2>void</FONT></FONT><FONT size=3><FONT size=2> CXTPTabClientWnd::UpdateContents().</FONT></P><DIV><FONT size=2></FONT></DIV><FONT size=2>The method contains the following code:</FONT><DIV></DIV><DIV><FONT size=2></FONT></DIV><FONT color=#0000ff><P><FONT size=2>if</FONT></FONT><FONT size=2> ((pChildWnd-&gt;GetStyle() &amp; WS_VISIBLE) == WS_VISIBLE)</FONT></P><P><FONT size=2>{</FONT></P><P><FONT color=#008000><FONT size=2>// add item</FONT></P></FONT><FONT size=3><P><FONT size=2>pNewItem = pFoundItem = AddItem(pChildWnd);</FONT></P><P><FONT size=2>pFoundItem-&gt;m_hWnd = pChildWnd-&gt;GetSafeHwnd();</FONT></P><P><FONT size=2>pFrameWnd-&gt;SendMessage(WM_XTP_NEWTABITEM, (WPARAM)pNewItem);</FONT></P><P><FONT size=2>pNewItem-&gt;GetTabManager()-&gt;SetSelectedItem(pNewItem);</FONT></P><P><FONT size=2>}</P><DIV></DIV>Method AddItem(pChildWnd) may return NULL (and I really got it!). In this case my application raises Access Violation on the next line because pFoundItem=NULL.&nbsp;So verification for NULL is needed:<DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><FONT color=#0000ff> </FONT><P><FONT size=2>if</FONT><FONT size=2> ((pChildWnd-&gt;GetStyle() &amp; WS_VISIBLE) == WS_VISIBLE)</FONT></P><P><FONT size=2>{</FONT></P><P><FONT color=#008000><FONT size=2>// add item</FONT></P></FONT><FONT size=3><P><FONT size=2>&nbsp;&nbsp; pNewItem = pFoundItem = AddItem(pChildWnd);</P><DIV>&nbsp;&nbsp; if (pFoundItem)</DIV><DIV>&nbsp;&nbsp; {</FONT><FONT size=2></FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pFoundItem-&gt;m_hWnd = pChildWnd-&gt;GetSafeHwnd();</FONT></DIV><P><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pFrameWnd-&gt;SendMessage(WM_XTP_NEWTABITEM, (WPARAM)pNewItem);</FONT></P><P><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pNewItem-&gt;GetTabManager()-&gt;SetSelectedItem(pNewItem);</P><DIV></FONT><FONT size=2>&nbsp;&nbsp; }</FONT></DIV><DIV><FONT size=2>}</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>This code works fine!</DIV></FONT></FONT></FONT></FONT></FONT>]]>
   </description>
   <pubDate>Mon, 19 Jun 2006 08:57:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=4434&amp;PID=13707&amp;title=bug-in-cxtptabclientwndupdatecontents#13707</guid>
  </item> 
 </channel>
</rss>