<?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 : Adding File Contents to AddRecordEx</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Adding File Contents to AddRecordEx]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 18 Apr 2026 18:36:37 +0000</pubDate>
  <lastBuildDate>Wed, 28 Oct 2009 16:29:15 +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=15464</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[Adding File Contents to AddRecordEx : Did you change CMessageRecord...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15464&amp;PID=54294&amp;title=adding-file-contents-to-addrecordex#54294</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15464<br /><strong>Posted:</strong> 28 October 2009 at 4:29pm<br /><br />Did you change <FONT size=2>CMessageRecord constructor? We have in sample - <FONT size=2>CMessageRecord(CString strItem1, CString strItem2, CString strItem3, CString strItem4); - smth like this - <FONT size=2>CMessageRecord(CString strItem1, CString strItem2 = _T(</FONT><FONT color=#a31515 size=2>""</FONT><FONT size=2>), CString strItem3 = _T(</FONT><FONT color=#a31515 size=2>""</FONT><FONT size=2>), CString strItem4 = _T(</FONT><FONT color=#a31515 size=2>""</FONT><FONT size=2>)); ?<DIV></DIV><DIV>&nbsp;</DIV><DIV>In this case use <FONT size=2>CMessageRecord* pMsg = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> CMessageRecord(MyString); </DIV><DIV>instead of your way - CMessageRecord* pMsg = new CMessageRecord ( MyString.GetString() ); </DIV><DIV>which generate memory leak.... Also be sure you have proper path and file exist - like this: <FONT size=2><P>CStdioFile Input( </FONT><FONT color=#a31515 size=2>"F:\\CodejockSVN\\bin\\TestText.txt"</FONT><FONT size=2>, CFile::modeRead );</P><DIV></FONT>Now all working well - but you will have each line of your text&nbsp;file as content of&nbsp;1st item - row by row - no nodes...<BR>&nbsp;</DIV></DIV></FONT></FONT></FONT></FONT>]]>
   </description>
   <pubDate>Wed, 28 Oct 2009 16:29:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15464&amp;PID=54294&amp;title=adding-file-contents-to-addrecordex#54294</guid>
  </item> 
  <item>
   <title><![CDATA[Adding File Contents to AddRecordEx : Hey I&amp;#039;ve been playing with...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15464&amp;PID=54211&amp;title=adding-file-contents-to-addrecordex#54211</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5577">EASX</a><br /><strong>Subject:</strong> 15464<br /><strong>Posted:</strong> 27 October 2009 at 4:39am<br /><br />Hey I've been playing with the sample "Report Sample for AddRecordEx" and I was wondering if it'd be possible to display file contents in different nodes. I really like how each node can be expanded and collapsed, so I think it would be convenient if a different .txt file could be displayed in each node, since they could be minimized and what not. But when I try the following code, the application crashes.<br><br>&nbsp;&nbsp;&nbsp; <table width="99%"><tr><td><pre class="BBcode">CString MyString;<br>&nbsp;&nbsp;&nbsp; CStdioFile Input ( "TestText.txt", CFile::modeRead );<br>&nbsp;&nbsp;&nbsp; for(int i = 0; i &lt; 6; i++ ) <br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Input.ReadString ( MyString );<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CMessageRecord* pMsg = new CMessageRecord ( MyString.GetString() );<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(pMsg)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pReportCtrl-&gt;SendMessage(WM_ADD_RECORD_EX, (WPARAM)pMsg, MAKELPARAM(i, 6));<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (pReportCtrl-&gt;GetParent())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CString strCaption(_T("Report Sample for AddRecordEx"));<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (i + 1 &lt; 6)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strCaption.Format(_T("Report Sample for AddRecordEx &#091;%d of %d&#093;"), i+1, 6);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pReportCtrl-&gt;GetParent()-&gt;SetWindowText(strCaption);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }</pre></td></tr></table><br><br>I'm sure I'm missing something, but I'm not sure what. If someone could help me out that'd be great <img src="http://forum.codejock.com/smileys/smiley1.gif" border="0" align="absmiddle"><br><br>]]>
   </description>
   <pubDate>Tue, 27 Oct 2009 04:39:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15464&amp;PID=54211&amp;title=adding-file-contents-to-addrecordex#54211</guid>
  </item> 
 </channel>
</rss>