<?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 : CString problems with /clr</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CString problems with /clr]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 16 Apr 2026 15:14:37 +0000</pubDate>
  <lastBuildDate>Fri, 18 Mar 2005 00:27:50 +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=1980</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[CString problems with /clr : So may be you need to compile...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1980&amp;PID=5793&amp;title=cstring-problems-with-clr#5793</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 1980<br /><strong>Posted:</strong> 18 March 2005 at 12:27am<br /><br />So may be you need to compile dll WITH /clr ?]]>
   </description>
   <pubDate>Fri, 18 Mar 2005 00:27:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1980&amp;PID=5793&amp;title=cstring-problems-with-clr#5793</guid>
  </item> 
  <item>
   <title><![CDATA[CString problems with /clr : Hello, I have decided to start...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1980&amp;PID=5785&amp;title=cstring-problems-with-clr#5785</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1051">zoobiedoo</a><br /><strong>Subject:</strong> 1980<br /><strong>Posted:</strong> 17 March 2005 at 11:40am<br /><br /><P>Hello,</P><P>I have decided to start using certain .Net Framework classes in my C++ MFC applications, so this requires&nbsp;complilation of the app&nbsp;using the /clr option.&nbsp;&nbsp;The stdafx.h file #includes the XTreme Toolkit Pro libraries.</P><P>The application uses the Codejock commandbars and when the app is run it returns a .Net&nbsp;"System.NullReferenceException" exception when CXTPCommandBars-&gt;SetMenu() is called in CMainFrame::OnCreate().&nbsp; Here is the code in question:</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><FONT color=#0000ff size=2><P>int</FONT><FONT size=2> CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)</P><P>{</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>&#091;...&#093;</P><FONT size=2><P>CXTPCommandBars* pCommandBars = GetCommandBars() ;</P></FONT><FONT size=2><P>CXTPCommandBar* pMenuBar = pCommandBars-&gt;SetMenu ( _T("Menu Bar"), IDR_MAINFRAME ) ;</P><P>&#091;...&#093;</P></BLOCKQUOTE><P dir=ltr>}</P></BLOCKQUOTE><P dir=ltr>Stepping into the code using the debugger shows that, inside CXTPCommandBars::GetMenu(), the value of the&nbsp;parameter CString strName seems to be garbage characters rather than the supplied value (ie. _T("Menu Bar") ) .&nbsp; This garbage CString is then passed to CXTPMenuBar::SetTitle() which errors out further up the call stack in the ATL/MFC class CSimpleStringT class.&nbsp;&nbsp;I'm guessing&nbsp;the error is caused by the garbage CString passed into GetMenu().</P><P dir=ltr>When the app is not compiled with /clr, the code works as expected.&nbsp; Also note that the XTreme Toolkit Pro dlls are NOT compiled using /clr in either case.</P><P dir=ltr>Has anyone run into this problem before?&nbsp; And/or can someone help with this?&nbsp; Thanks.</P></FONT></FONT>]]>
   </description>
   <pubDate>Thu, 17 Mar 2005 11:40:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1980&amp;PID=5785&amp;title=cstring-problems-with-clr#5785</guid>
  </item> 
 </channel>
</rss>