Adding File Contents to AddRecordEx |
Post Reply |
Author | |
EASX
Newbie Joined: 30 September 2009 Status: Offline Points: 7 |
Post Options
Thanks(0)
Posted: 27 October 2009 at 4:39am |
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.
I'm sure I'm missing something, but I'm not sure what. If someone could help me out that'd be great |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Did you change CMessageRecord constructor? We have in sample - CMessageRecord(CString strItem1, CString strItem2, CString strItem3, CString strItem4); - smth like this - CMessageRecord(CString strItem1, CString strItem2 = _T(""), CString strItem3 = _T(""), CString strItem4 = _T("")); ?
In this case use CMessageRecord* pMsg = new CMessageRecord(MyString);
instead of your way - CMessageRecord* pMsg = new CMessageRecord ( MyString.GetString() );
which generate memory leak.... Also be sure you have proper path and file exist - like this:
CStdioFile Input( "F:\\CodejockSVN\\bin\\TestText.txt", CFile::modeRead );Now all working well - but you will have each line of your text file as content of 1st item - row by row - no nodes... |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |