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?
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).
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.
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.
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.
Bookmarks