<?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 : CXTShellTree and UNC Path</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTShellTree and UNC Path]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 13 Apr 2026 10:51:16 +0000</pubDate>
  <lastBuildDate>Wed, 22 Jul 2009 11:11:11 +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=14794</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[CXTShellTree and UNC Path : Did you know that the CXTShellTree...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14794&amp;PID=51185&amp;title=cxtshelltree-and-unc-path#51185</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=504">AliRafiee</a><br /><strong>Subject:</strong> 14794<br /><strong>Posted:</strong> 22 July 2009 at 11:11am<br /><br />Did you know that the CXTShellTree control's PopulateTree method doesn't work with UNC paths?<DIV>&nbsp;</DIV><DIV>The problem is in PathFindNextComponent or <FONT size=2>XTFuncPathFindNextComponent depending on which version of the library you are using.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Anyway, that method will return an invalid path if a UNC path is passed to it</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>in the PathFindNextComponent the if statement should be</FONT></DIV><DIV><FONT size=2></FONT><FONT size=2>&nbsp;</DIV><DIV>CString CXTShellTreeBase::PathFindNextComponent(const CString&amp; pszPath)</DIV><DIV>{</DIV><DIV>&nbsp; // Find the path delimiter</DIV><DIV>&nbsp;&nbsp; int nIndex = pszPath.Find(_T('\\'));</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; //if one wasn't found, or the first char is the \</DIV><DIV>&nbsp;&nbsp; if (nIndex &lt;= 0)</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return _T("");</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; return pszPath.Mid(nIndex + 1);</DIV><DIV>}</DIV><DIV></DIV><P>and XTFuncPathFindNextComponent should be:</P><DIV></DIV><FONT size=2><DIV>_XT_EXT_CLASS LPTSTR AFXAPI XTFuncPathFindNextComponent(LPTSTR pszPath)</DIV><DIV>{</DIV><DIV>&nbsp; // We will return static memory</DIV><DIV>&nbsp;&nbsp; static TCHAR tNextComponent&#091;MAX_PATH + 1&#093;;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; // Make sure we were given a valid path</DIV><DIV>&nbsp;&nbsp; if ( pszPath == NULL || _tcslen( pszPath ) == 0 ) {</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NULL;</DIV><DIV>&nbsp;&nbsp; }</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; // Find the path delimiter</DIV><DIV>&nbsp;&nbsp; TCHAR *cp = _tcschr( pszPath, _T('\\') );</DIV><DIV>&nbsp;</DIV><DIV><DIV>&nbsp;&nbsp; //if one wasn't found, or the first char is the \</DIV></DIV><DIV>&nbsp;&nbsp; if ( cp == NULL || cp == pszPath) {</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If we didn't find it, return an empty string</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tNextComponent&#091;0&#093; = 0;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return tNextComponent;</DIV><DIV>&nbsp;&nbsp; }</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp; // OK, we have the delimiter. Copy the rest of</DIV><DIV>&nbsp;&nbsp; // the path to our internal buffer and return it</DIV><DIV>&nbsp;&nbsp; STRCPY_S( tNextComponent, MAX_PATH , cp + 1 );</DIV><DIV>&nbsp;&nbsp; return tNextComponent;</DIV><DIV>}</DIV><P></FONT><FONT size=2>&nbsp;</P></FONT></FONT>]]>
   </description>
   <pubDate>Wed, 22 Jul 2009 11:11:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14794&amp;PID=51185&amp;title=cxtshelltree-and-unc-path#51185</guid>
  </item> 
 </channel>
</rss>