Click here to Skip to main content
15,928,330 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralBitmap Procedure works - but no Bitmap appears on the screen!! Pin
14-Mar-01 8:52
suss14-Mar-01 8:52 
GeneralRe: Bitmap Procedure works - but no Bitmap appears on the screen!! Pin
Christian Graus14-Mar-01 11:40
protectorChristian Graus14-Mar-01 11:40 
General__stdcall and Member Functions Pin
Rhoam14-Mar-01 8:12
Rhoam14-Mar-01 8:12 
GeneralRe: __stdcall and Member Functions Pin
Chris Losinger14-Mar-01 9:04
professionalChris Losinger14-Mar-01 9:04 
GeneralRe: __stdcall and Member Functions Pin
Erik Funkenbusch14-Mar-01 11:47
Erik Funkenbusch14-Mar-01 11:47 
Questiongantt? Pin
bogdan14-Mar-01 7:48
bogdan14-Mar-01 7:48 
AnswerRe: gantt? Pin
David Cunningham14-Mar-01 12:23
cofounderDavid Cunningham14-Mar-01 12:23 
GeneralExport bitmap to RTF file Pin
14-Mar-01 7:33
suss14-Mar-01 7:33 
QuestionLoading a Bitmap - but how? Pin
14-Mar-01 4:12
suss14-Mar-01 4:12 
AnswerRe: Loading a Bitmap - but how? Pin
14-Mar-01 4:19
suss14-Mar-01 4:19 
AnswerRe: Loading a Bitmap - but how? Pin
14-Mar-01 4:22
suss14-Mar-01 4:22 
GeneralThanks Pin
14-Mar-01 0:14
suss14-Mar-01 0:14 
GeneralNeed to partition a hard disk programming... Pin
Ammar13-Mar-01 20:31
Ammar13-Mar-01 20:31 
QuestionChildframe maximized question? Pin
The Ironduke13-Mar-01 17:56
The Ironduke13-Mar-01 17:56 
AnswerRe: Childframe maximized question? Pin
orcun colak14-Mar-01 6:43
orcun colak14-Mar-01 6:43 
GeneralNeed help quick on a couple of silly simple problems Pin
David LeBlanc13-Mar-01 13:30
David LeBlanc13-Mar-01 13:30 
GeneralRe: Need help quick on a couple of silly simple problems Pin
Joe Moldovan13-Mar-01 14:33
Joe Moldovan13-Mar-01 14:33 
GeneralRe: Need help quick on a couple of silly simple problems Pin
Steve Driessens13-Mar-01 17:16
Steve Driessens13-Mar-01 17:16 
GeneralRe: Need help quick on a couple of silly simple problems Pin
Ammar13-Mar-01 20:29
Ammar13-Mar-01 20:29 
GeneralRe: Need help quick on a couple of silly simple problems Pin
Peter Godec14-Mar-01 13:27
Peter Godec14-Mar-01 13:27 
GeneralNeed help quick on a couple of silly simple problems Pin
David LeBlanc13-Mar-01 13:29
David LeBlanc13-Mar-01 13:29 
GeneralQuestion about CListControl Pin
13-Mar-01 12:51
suss13-Mar-01 12:51 
GeneralRe: Question about CListControl Pin
Christian Graus13-Mar-01 23:46
protectorChristian Graus13-Mar-01 23:46 
I'm surprised no-one answered this already - I had to wait to get home and look at code where I did it.

I'm using SetItemText to put them in, but GetItemText takes them back out the same way:

// Create list view columns
LV_COLUMN listColumn;
LV_ITEM listItem;
char* arColumns[2] = { "Account", "Password"};
listColumn.mask = LVCF_FMT|LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM;
listColumn.fmt = LVCFMT_LEFT;
int Width[2]={190,63};
listColumn.cx = 180;
for ( int nColumn = 0;nColumn<2;nColumn++)
{
listColumn.cx = Width[nColumn];
listColumn.iSubItem = nColumn;
listColumn.pszText = arColumns[nColumn];
m_listCtrl.InsertColumn(nColumn,&listColumn);
}

// Add list items

listItem.mask = LVIF_TEXT | LVIF_IMAGE;
listItem.iSubItem = 0;

TCWACCOUNT* pCurrent;
pCurrent = m_TCWACCOUNT.pNext;
int nItem = 0;
while(pCurrent != NULL)
{
listItem.iItem = nItem;
listItem.pszText = pCurrent->pCustName;
CString Check = (CString)pCurrent->pPasswd;
if (Check.Left(4) == "NuLl")
{
listItem.iImage = 1;
m_listCtrl.InsertItem (&listItem);
m_listCtrl.SetItemText (nItem, 1, "No");
}
else
{
listItem.iImage = 0;
m_listCtrl.InsertItem (&listItem);
m_listCtrl.SetItemText (nItem, 1, "Yes");
}
pCurrent = pCurrent->pNext;
nItem++;

}

Ignore all the account stuff, it's just stepping through a linked list. The important part is that the item is the row, the sub item is the column. GetItemText looks like this in the MSDN:

int GetItemText( int nItem, int nSubItem, LPTSTR lpszText, int nLen ) const;

CString GetItemText( int nItem, int nSubItem ) const;

So you can do this

for (int i = 0; i < listsize; i++)
{

Column1[i] = m_List.GetItemText(i, 0);
Column2[i] = m_List.GetItemText(i, 1);
Column3[i] = m_List.GetItemText(i, 2);
}

Of course, you'd be better putting them in a struct ( or class ) but that is another story....



Christian

The content of this post is not necessarily the opinion of my yadda yadda yadda.

To understand recursion, we must first understand recursion.
GeneralDisable CListCtrl Auto Selection Pin
13-Mar-01 11:53
suss13-Mar-01 11:53 
QuestionDo I need Access 2000 royalty free runtime libraries? Pin
Brendan Tregear13-Mar-01 10:24
Brendan Tregear13-Mar-01 10:24 

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.