Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRequest: Sample Code for implementing a toolbar control with hot tracking enabled Pin
Vivek Chawla22-Apr-00 12:04
Vivek Chawla22-Apr-00 12:04 
GeneralRe: Request: Sample Code for implementing a toolbar control with hot tracking enabled Pin
Chris Maunder22-Apr-00 12:38
cofounderChris Maunder22-Apr-00 12:38 
GeneralMFC Console Apps Pin
frank22-Apr-00 8:56
frank22-Apr-00 8:56 
GeneralSql statement and dates. Pin
Ben22-Apr-00 4:53
Ben22-Apr-00 4:53 
GeneralRe: Sql statement and dates. Pin
Chris Maunder22-Apr-00 12:43
cofounderChris Maunder22-Apr-00 12:43 
QuestionHow to add bitmap to one of the PropertyPaeg title? Pin
linda22-Apr-00 2:48
linda22-Apr-00 2:48 
GeneralView doesn't get updated -Gray outs Pin
arshadwkhan22-Apr-00 2:18
arshadwkhan22-Apr-00 2:18 
GeneralCListCtrl - realtime scrolling Pin
Jeffrey Wedekind 21-Apr-00 11:19
sussJeffrey Wedekind 21-Apr-00 11:19 
I am using the ClistCtrl control to display packet traffic on a serial I/O line. I use Scroll() so the
most recent packet appers on the bottom of the list. Once I reach an upper limit I call
DeleteItem(0) to keep the total rows at a fixed limit. The code shown below works but once the
upper limit is reached the CListCtrl scrolls the header off the screen which is weird. The only way
I've been able to get around this is to call RedrawItems() but this causes way to much flicker. I'm
I missing something? I used to do this with ListBox() without any problems. Oh there also seems
to be an upper limit to how many characters I can put into a cell of about 200 chars and if I exceed
this the cpu activity shoots to 99 and locks the app - fyi.

void CCListCtrlAdv::SetColumnData(CStringListEx& strlist, int nIndex)
{
if(strlist.GetCount())
{
if(GetItemCount() >= m_nMaxItemCount)
{
DeleteItem(INDEX_0);
RedrawItems(0, GetItemCount()); // causes to much flicker
}

int column = 0;
POSITION pos = strlist.GetHeadPosition();

if(nIndex == INVALID)
{
nIndex = GetItemCount();
}

while(pos)
{
CString& str = strlist.GetNext(pos);

if(column == COLUMN_0)
{
SET_LV_ITEM(lvi);
lvi.mask = LVIF_TEXT;
lvi.iItem = nIndex;
lvi.pszText = str.GetBuffer(0);
lvi.cchTextMax = str.GetLength();
InsertItem(&lvi);
}
else
{
SetItemText(nIndex, column, str.GetBuffer(0));
}

column++;
}

if(nIndex > GetCountPerPage()-1)
{
CRect rect;
GetItemRect(GetTopIndex(), rect, LVIR_BOUNDS);
CSize size;
size.cx = 0;
size.cy = rect.Height();
Scroll(size);
}
}
}




GeneralRe: CListCtrl - realtime scrolling Pin
Mike Dunn21-Apr-00 18:42
Mike Dunn21-Apr-00 18:42 
GeneralModem - bytes sent/received Pin
Grzegorz 'Ygreg' Plebanski21-Apr-00 10:23
sussGrzegorz 'Ygreg' Plebanski21-Apr-00 10:23 
GeneralRe: Modem - bytes sent/received Pin
Buck22-Apr-00 2:36
Buck22-Apr-00 2:36 
GeneralBest method Exceptions without MFC Pin
PeterK21-Apr-00 8:19
PeterK21-Apr-00 8:19 
GeneralDevice context Pin
Homber Martinez21-Apr-00 6:15
Homber Martinez21-Apr-00 6:15 
GeneralRe: Device context Pin
Paul Wolfensberger21-Apr-00 6:42
Paul Wolfensberger21-Apr-00 6:42 
GeneralRe: Device context Pin
Homber Martinez21-Apr-00 7:09
Homber Martinez21-Apr-00 7:09 
GeneralRe: Device context Pin
Cristi Posea21-Apr-00 10:22
Cristi Posea21-Apr-00 10:22 
GeneralRe: Device context Pin
Homber Martinez21-Apr-00 18:43
Homber Martinez21-Apr-00 18:43 
GeneralRe: Device context Pin
Cristi Posea22-Apr-00 9:28
Cristi Posea22-Apr-00 9:28 
GeneralRe: Device context Pin
Member 475122-Apr-00 4:44
Member 475122-Apr-00 4:44 
GeneralDevice context Pin
Homber Martinez21-Apr-00 6:15
Homber Martinez21-Apr-00 6:15 
GeneralToolbar button Pin
Danny20-Apr-00 20:19
Danny20-Apr-00 20:19 
GeneralRe: Toolbar button Pin
Mike Dunn21-Apr-00 5:39
Mike Dunn21-Apr-00 5:39 
GeneralImageList_Duplicate Bug!! Pin
Neville Franks20-Apr-00 15:20
Neville Franks20-Apr-00 15:20 
QuestionHow to Use TabCtrl ocx in VC? Pin
tiger20-Apr-00 13:59
tiger20-Apr-00 13:59 
QuestionCan I change text and background colors on dialogs? Pin
Mike20-Apr-00 9:40
Mike20-Apr-00 9:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.