Click here to Skip to main content
15,920,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFunction return? Pin
dipuks26-Aug-09 7:39
dipuks26-Aug-09 7:39 
AnswerRe: Function return? Pin
Code-o-mat26-Aug-09 9:14
Code-o-mat26-Aug-09 9:14 
Question/embedding setting does not work on Vista Pin
Fwzklmn26-Aug-09 7:35
Fwzklmn26-Aug-09 7:35 
QuestionHow do some viruses act without appearing in task manager? Pin
Joseph Marzbani26-Aug-09 7:00
Joseph Marzbani26-Aug-09 7:00 
AnswerRe: How do some viruses act without appearing in task manager? Pin
zhu_lin26-Aug-09 22:31
zhu_lin26-Aug-09 22:31 
QuestionSetting the item count for a CListBox 'No Data' control Pin
tmcart26-Aug-09 5:38
tmcart26-Aug-09 5:38 
AnswerRe: Setting the item count for a CListBox 'No Data' control Pin
David Crow26-Aug-09 6:10
David Crow26-Aug-09 6:10 
QuestionRe: Setting the item count for a CListBox 'No Data' control [modified] Pin
tmcart26-Aug-09 6:47
tmcart26-Aug-09 6:47 
DavidCrow wrote:
tmcart wrote:
#define LB_SETCOUNT 0x1A7

Why are you redefining this?


I am needing to define the LB_SETCOUNT as it isn't defined in 'windows mobile 6 sdk\pocketpc\include\armv4i\winuser.h' so I found the correct hex message code via google.

DavidCrow wrote:

tmcart wrote:
result = m_listbox.SendMessage(LB_SETCOUNT, (WPARAM)(int)5000, (LPARAM)0);

The LB_SETCOUNT message sets the number of items that the control will ultimately contain.


I'm not sure what you are getting at with your emphasis here?

What I was hoping from the LB_SETCOUNT is that would tell the CListBox it has 5000 virtual items. Thus when the CListBox's DrawItem() gets called the scroll bars and itemID range is based around having 5000 items.

CString CTestDialog::GetDataAt(size_t index)
{
    return m_data[index];
}


void CVListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
    CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
    RECT r(lpDrawItemStruct->rcItem);
    CTestDialog *pDlg = (CTestDialog *)GetParent();
    CString text = L"<Default>";
    RECT focus(r);

    ASSERT(pDC);
    if (!pDC) return;

    if ((int)lpDrawItemStruct->itemID < 0)
    {
        if (lpDrawItemStruct->itemAction & ODA_FOCUS)
        {
            pDC->DrawFocusRect(&focus);
            pDC->Detach();
        }
        return;
    }

    text = pDlg->GetDataAt(lpDrawItemStruct->itemID);

    pDC->DrawText(text,
                  text.GetLength(),
                  &r, 
                  DT_LEFT | DT_SINGLELINE | DT_VCENTER);

    pDC->Detach();
}


modified on Thursday, August 27, 2009 5:42 AM

AnswerRe: Setting the item count for a CListBox 'No Data' control Pin
tmcart3-Sep-09 23:39
tmcart3-Sep-09 23:39 
QuestionLimit Number of connections from a given IP Pin
Veandhan26-Aug-09 5:26
Veandhan26-Aug-09 5:26 
QuestionRe: Limiting Connections from a given IP in MFC Pin
CPallini26-Aug-09 5:47
mveCPallini26-Aug-09 5:47 
AnswerRe: Limiting Connections from a given IP in MFC Pin
Rajesh R Subramanian26-Aug-09 7:48
professionalRajesh R Subramanian26-Aug-09 7:48 
AnswerRe: Limiting Connections from a given IP in MFC Pin
David Crow26-Aug-09 9:22
David Crow26-Aug-09 9:22 
GeneralRe: Limiting Connections from a given IP in MFC Pin
Rajesh R Subramanian26-Aug-09 18:49
professionalRajesh R Subramanian26-Aug-09 18:49 
GeneralRe: Limiting Connections from a given IP in MFC Pin
CPallini26-Aug-09 21:36
mveCPallini26-Aug-09 21:36 
JokeRe: Limiting Connections from a given IP in MFC Pin
Rajesh R Subramanian26-Aug-09 22:22
professionalRajesh R Subramanian26-Aug-09 22:22 
JokeRe: Limiting Connections from a given IP in MFC Pin
CPallini26-Aug-09 22:37
mveCPallini26-Aug-09 22:37 
GeneralRe: Limiting Connections from a given IP in MFC Pin
Rajesh R Subramanian26-Aug-09 23:09
professionalRajesh R Subramanian26-Aug-09 23:09 
QuestionRe: Limiting Connections from a given IP in MFC Pin
David Crow26-Aug-09 6:03
David Crow26-Aug-09 6:03 
AnswerRe: Limit Number of connections from a given IP Pin
Rajesh R Subramanian26-Aug-09 7:41
professionalRajesh R Subramanian26-Aug-09 7:41 
QuestionRe: Limit Number of connections from a given IP Pin
Veandhan26-Aug-09 15:54
Veandhan26-Aug-09 15:54 
AnswerRe: Limit Number of connections from a given IP Pin
Rajesh R Subramanian26-Aug-09 16:51
professionalRajesh R Subramanian26-Aug-09 16:51 
GeneralRe: Limit Number of connections from a given IP Pin
Veandhan26-Aug-09 16:57
Veandhan26-Aug-09 16:57 
GeneralRe: Limit Number of connections from a given IP Pin
Rajesh R Subramanian26-Aug-09 17:05
professionalRajesh R Subramanian26-Aug-09 17:05 
GeneralRe: Limit Number of connections from a given IP Pin
Veandhan26-Aug-09 20:19
Veandhan26-Aug-09 20:19 

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.