Click here to Skip to main content
15,925,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to solve Fatel Errors.... Pin
Vetukuri,Murali26-Aug-09 18:05
Vetukuri,Murali26-Aug-09 18:05 
AnswerRe: How to solve Fatel Errors.... Pin
Joseph Marzbani26-Aug-09 18:21
Joseph Marzbani26-Aug-09 18:21 
AnswerSollution: How to solve Fatel Errors (C1189 due to _AFXDLL).... Pin
Volodymyr Frytskky (Vladonai Software)13-Jul-11 0:38
Volodymyr Frytskky (Vladonai Software)13-Jul-11 0:38 
QuestionHow do some viruses run their threads without appareaning in the task manager? Pin
Joseph Marzbani26-Aug-09 17:53
Joseph Marzbani26-Aug-09 17:53 
AnswerRe: How do some viruses run their threads without appareaning in the task manager? Pin
Adam Roderick J26-Aug-09 18:36
Adam Roderick J26-Aug-09 18:36 
GeneralRe: How do some viruses run their threads without appareaning in the task manager? Pin
Joseph Marzbani26-Aug-09 21:26
Joseph Marzbani26-Aug-09 21:26 
GeneralRe: How do some viruses run their threads without appareaning in the task manager? Pin
Adam Roderick J26-Aug-09 22:09
Adam Roderick J26-Aug-09 22:09 
AnswerRe: How do some viruses run their threads without appareaning in the task manager? Pin
David Crow27-Aug-09 2:51
David Crow27-Aug-09 2:51 
Questionconnect to a DB2 database from the VC++ Pin
intermediate26-Aug-09 13:08
intermediate26-Aug-09 13:08 
AnswerRe: connect to a DB2 database from the VC++ Pin
N a v a n e e t h26-Aug-09 17:18
N a v a n e e t h26-Aug-09 17:18 
QuestionRe: connect to a DB2 database from the VC++ Pin
David Crow26-Aug-09 17:31
David Crow26-Aug-09 17:31 
AnswerRe: connect to a DB2 database from the VC++ Pin
Rajesh R Subramanian26-Aug-09 20:06
professionalRajesh R Subramanian26-Aug-09 20:06 
QuestionCRegKey and Vista permissions Pin
jeffb4226-Aug-09 12:55
jeffb4226-Aug-09 12:55 
AnswerRe: CRegKey and Vista permissions Pin
David Crow26-Aug-09 17:30
David Crow26-Aug-09 17:30 
QuestionPassword Program Help Please!!! Pin
posidonofthecode26-Aug-09 10:06
posidonofthecode26-Aug-09 10:06 
AnswerRe: Password Program Help Please!!! Pin
David Crow26-Aug-09 10:58
David Crow26-Aug-09 10:58 
GeneralRe: Password Program Help Please!!! Pin
posidonofthecode27-Aug-09 14:29
posidonofthecode27-Aug-09 14:29 
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

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.