Click here to Skip to main content
16,011,743 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to implement XOR-PUT bitmap drawing ? Pin
5-Jan-01 1:24
suss5-Jan-01 1:24 
AnswerRe: How to implement XOR-PUT bitmap drawing ? Pin
NormDroid5-Jan-01 4:45
professionalNormDroid5-Jan-01 4:45 
GeneralNetwork Provider DLL Pin
Shawnerton4-Jan-01 13:33
Shawnerton4-Jan-01 13:33 
GeneralNetwork Provider DLL Pin
Shawnerton4-Jan-01 13:33
Shawnerton4-Jan-01 13:33 
GeneralNetwork Provider DLL Pin
Shawnerton4-Jan-01 13:32
Shawnerton4-Jan-01 13:32 
GeneralRetrieve messages from other processes Pin
4-Jan-01 13:15
suss4-Jan-01 13:15 
GeneralCListCtrl performance Pin
4-Jan-01 9:14
suss4-Jan-01 9:14 
GeneralRe: CListCtrl performance Pin
4-Jan-01 9:44
suss4-Jan-01 9:44 
Try making it a virtual list control. This means you need to respond to the LVN_GETDISPINFO message. This message is sent to your control when it needs to be repainted. A call to SetItemCountEx() tells the control how many items should be in the list. I usually load up 100 or so items at a time so that the control does not allocate anything until the user actually pages down. This is great for incremental searching, but it does mess up the scroll bar (when the user pages down enough another block of 100 items is SetItemCountEx()'d, so the scroll bar recalculates its relative position). In the OnGetDispInfoXXX callback you need to use CRecordset::SetAbsolutePosition(nListIndex) to retrieve the correct record.

Here's a snippet (LIST_BLOCK_SIZE = 100)
//==============================================================================
void CLogReviewDlg::OnGetdispinfoListLog(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
LV_ITEM* pItem = &(pDispInfo)->item;

int nIndex = pItem->iItem + 1;
if (pItem->mask & LVIF_TEXT && nIndex <= m_nRecCount)
{
if (nIndex >= m_nListCount && m_nListCount != m_nRecCount)
{
m_nListCount += LIST_BLOCK_SIZE;
if (m_nListCount > m_nRecCount)
{
m_nListCount = m_nRecCount;
}
m_ctlListLog.SetItemCountEx(m_nListCount, LVSICF_NOINVALIDATEALL | LVSICF_NOSCROLL);
}

try
{
m_rsLogData.SetAbsolutePosition(nIndex);
}
catch (CDBException* pEx)
{
TRACE("Database exception %s", pEx->m_strError);

pEx->Delete();
}

switch (pItem->iSubItem)
{
case COLUMN_CATEGORY:
lstrcpy(pItem->pszText, m_rsLogData.m_Category);
break;

case COLUMN_PROCESS:
lstrcpy(pItem->pszText, m_rsLogData.m_Process);
break;

case COLUMN_INSTANCE:
wsprintf(pItem->pszText, "%d", m_rsLogData.m_Instance);
break;

case COLUMN_TIMESTAMP:
lstrcpy(pItem->pszText, m_rsLogData.m_DateTime.Format("%m/%d/%Y %H:%M:%S"));
break;

case COLUMN_MILLISEC:
wsprintf(pItem->pszText, "%d", m_rsLogData.m_Milliseconds);
break;

case COLUMN_FUNCTION:
lstrcpy(pItem->pszText, m_rsLogData.m_Function);
break;

case COLUMN_LOG_TEXT:
lstrcpy(pItem->pszText, m_rsLogData.m_LogText);
break;

default:
TRACE("Product List control column out of range %d", pItem->iSubItem);
break;
}
}

*pResult = 0;
}

Hope it helps.
GeneralRe: CListCtrl performance Pin
4-Jan-01 13:15
suss4-Jan-01 13:15 
GeneralRe: CListCtrl performance Pin
5-Jan-01 5:48
suss5-Jan-01 5:48 
QuestionHow to desgine a chat software for voice in VC++ ? Please Help ! Pin
4-Jan-01 8:32
suss4-Jan-01 8:32 
AnswerRe: How to desgine a chat software for voice in VC++ ? Please Help ! Pin
26-Jan-01 0:34
suss26-Jan-01 0:34 
GeneralRe: How to desgine a chat software for voice in VC++ ? Please Help ! Pin
wildchaser29-May-01 19:12
wildchaser29-May-01 19:12 
GeneralRe: How to desgine a chat software for voice in VC++ ? Please Help ! Pin
Christian Graus29-May-01 19:21
protectorChristian Graus29-May-01 19:21 
QuestionHow to desgine a chat software for voice in VC++ ? Please Help ! Pin
4-Jan-01 8:30
suss4-Jan-01 8:30 
GeneralConsole text color Pin
4-Jan-01 6:59
suss4-Jan-01 6:59 
GeneralRe: Console text color Pin
Tim Deveaux4-Jan-01 8:21
Tim Deveaux4-Jan-01 8:21 
GeneralGenerating words Pin
4-Jan-01 6:56
suss4-Jan-01 6:56 
GeneralRe: Generating words Pin
Christian Graus4-Jan-01 10:55
protectorChristian Graus4-Jan-01 10:55 
GeneralRe: Generating words Pin
Christian Graus4-Jan-01 11:00
protectorChristian Graus4-Jan-01 11:00 
QuestionHow to use IPAdress Control in VB ?? Pin
Patrick4-Jan-01 2:09
Patrick4-Jan-01 2:09 
Generalgetting info about another process Pin
subir talukder4-Jan-01 1:39
subir talukder4-Jan-01 1:39 
Generalgetting info about another process Pin
subir talukder4-Jan-01 1:37
subir talukder4-Jan-01 1:37 
Generalgetting info about another process Pin
subir talukder4-Jan-01 1:37
subir talukder4-Jan-01 1:37 
GeneralMake Controls Invisible Pin
3-Jan-01 14:58
suss3-Jan-01 14:58 

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.