-
December 9th, 2008, 01:08 AM
#1
Best display control for displaying 4000 bytes(characters)
Hello ,
I am working on SDK.
Presently my display control is list control.
display looks like this
Sln. Time Protocol Tx Data pattern
1 12:45 UART 1 abc...... MX
My code snippet(pseudo) is ..
/******************************************************/
LVCOLUMN listCol;
memset(&listCol, 0, sizeof(LVCOLUMN));
listCol.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
listCol.pszText = "Sl No";
listCol.cx = 0x28;
SendMessage(hRxWindow,LVM_INSERTCOLUMN,0,(LPARAM)&listCol);
ListView_SetItemText(GetDlgItem(hMainDlg,IDC_LIST_RX),nItemCount,1,tempbuf);
//tempbuf = "abc............z"//4000bytes, no NULL
/******************************************************/
The problem is, I have to display 4000 bytes on data column.
1.How to get this done in GUI with list control?
2.Any other GUI control required to do this?
Just basic information is enough.
Regards
Nikhil
-
December 9th, 2008, 03:09 AM
#2
Re: Best display control for displaying 4000 bytes(characters)
I have to display 4000 bytes on data column
I doubt that... do you really think it's useful to display 4kb of data in a column ?? Also, I don't think a listview allows it.
-
December 9th, 2008, 10:24 AM
#3
Re: Best display control for displaying 4000 bytes(characters)
For the text limitation, see your other thread: http://www.codeguru.com/forum/showthread.php?t=466602.
I agree with Skizmo. A list view is not a good idea for what you want to display. My suggestion is that you remove that column from the list view, and add another control (could be a simple edit, or a rich edit, or something custom) to your window. Whenever, the user selects an item in the list view, you populate this second control that data (4000 chars).
-
December 12th, 2008, 05:18 AM
#4
Re: Best display control for displaying 4000 bytes(characters)
Hello,
So this way we solved it !!
1. We created an edit box(read only)
2. The data stream that is received from port is directly displayed on edit box as well as list control.
3. The stream also gets copied into temporary data file, tempfile(HIDDEN, READ ONLY) with encryption.
4. When user reads n number of streams, always latest stream will be available into edit box.
5.However if user clicks on any row, corresponding data from tempfile gets copied into edit box.Some co-relation logic.
6.temp file gets deleted upon application exit.
Thanks for ur help !!
-
December 12th, 2008, 05:55 AM
#5
Re: Best display control for displaying 4000 bytes(characters)
But why did you copy that on a temporary file? You can just keep it in memory. You can associate with each list item "data", which is actually a numerical value, and can be a pointer. You can store your 4000 bytes for each item in memory, and associate with the item the pointer to that memory. You only have to make sure, when you clear the list, you iterate through the items and delete that memory.
See SetItemData() and GetItemData().
-
December 12th, 2008, 06:54 AM
#6
Re: Best display control for displaying 4000 bytes(characters)
Yah. I thought that initially. The issue pinned is, as the application can run for long, Might not be good idea to keep data volatile.
Here,even if application crashes data is intact and recoverable.
-
December 12th, 2008, 07:02 AM
#7
Re: Best display control for displaying 4000 bytes(characters)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|