Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIssues with HtmlHelp Pin
Shaffiq16-Aug-06 4:19
Shaffiq16-Aug-06 4:19 
AnswerRe: Issues with HtmlHelp Pin
Sam Levy16-Aug-06 8:37
Sam Levy16-Aug-06 8:37 
GeneralRe: Issues with HtmlHelp Pin
Shaffiq16-Aug-06 20:03
Shaffiq16-Aug-06 20:03 
QuestionCImageList and CListCtrl Pin
Wim Engberts16-Aug-06 4:11
Wim Engberts16-Aug-06 4:11 
QuestionRe: CImageList and CListCtrl Pin
David Crow16-Aug-06 5:18
David Crow16-Aug-06 5:18 
AnswerRe: CImageList and CListCtrl Pin
Wim Engberts16-Aug-06 6:07
Wim Engberts16-Aug-06 6:07 
QuestionRe: CImageList and CListCtrl Pin
David Crow16-Aug-06 6:22
David Crow16-Aug-06 6:22 
AnswerRe: CImageList and CListCtrl Pin
Wim Engberts16-Aug-06 9:04
Wim Engberts16-Aug-06 9:04 
I am using a derived class "CListCtrlEx", which has the following code for adding a row:

BOOL CListCtrlEx::AddLine(char *Elements, UINT Id, int iImage)
{
LVITEM Item;
register int i = 0;
register int j = 0;
int subItem = 0;
int r = 1;
int k = 0;
char szItem[256];

memset (&Item, '\0', sizeof (LVITEM));
Item.mask = LVIF_TEXT|LVIF_PARAM;
Item.iItem = m_ItemId++;
Item.lParam = Id;
while (r && Elements[k] != '\0')
{
j = k;
i = 0;

while (Elements[j] != '\0'&&
Elements[j] != '\t')
{
if (i < 250)
szItem[i++] = Elements[j];
j++;
}
szItem[i] = '\0';
Item.iSubItem = subItem++;
Item.pszText = &szItem[0];
if (k == 0)
{
if (iImage != -1)
{
Item.iImage = iImage;
Item.mask |= LVIF_IMAGE;
}
if (InsertItem (&Item) == -1)
r = 0;
else
r = 1;
}
else if ((r = SetItem (&Item)) != 0)
r = 1;

if (Elements[k=j] == '\t')
k++;
Item.mask = LVIF_TEXT;
}
return r;
}

I present this routinew with a character array in which the elements (columns) are separated by tabs. As you can see, the routine only adds an image when the parameter "iImage" does not equal -1, which it does when I populate the contgrol with only recent items where I do not want to see icons. Again: The icons do not show, but the space for the icons remains reserved, which leads to the situation that, on first appearance, the left elements are completely left aligned, but after showing the history items, they always show shifted to the right.

William
QuestionHow to replace Microsoft system MessageBox Pin
xiayingang16-Aug-06 4:06
xiayingang16-Aug-06 4:06 
AnswerRe: How to replace Microsoft system MessageBox Pin
Rage16-Aug-06 5:25
professionalRage16-Aug-06 5:25 
GeneralRe: How to replace Microsoft system MessageBox Pin
xiayingang17-Aug-06 20:41
xiayingang17-Aug-06 20:41 
AnswerRe: How to replace Microsoft system MessageBox Pin
A_Fa16-Aug-06 21:06
A_Fa16-Aug-06 21:06 
AnswerRe: How to replace Microsoft system MessageBox Pin
Hamid_RT17-Aug-06 6:13
Hamid_RT17-Aug-06 6:13 
QuestionHow To add a Dialog Window in The MDI Pin
cybersadhu16-Aug-06 3:57
cybersadhu16-Aug-06 3:57 
AnswerRe: How To add a Dialog Window in The MDI Pin
Maximilien16-Aug-06 4:07
Maximilien16-Aug-06 4:07 
AnswerRe: How To add a Dialog Window in The MDI Pin
Hamid_RT16-Aug-06 22:08
Hamid_RT16-Aug-06 22:08 
QuestionCreateFile question Pin
Tushar Mahajan16-Aug-06 3:32
Tushar Mahajan16-Aug-06 3:32 
AnswerRe: CreateFile question Pin
Mircea Puiu16-Aug-06 23:06
Mircea Puiu16-Aug-06 23:06 
QuestionInclude Files and Folder Structure Pin
pgav16-Aug-06 3:28
pgav16-Aug-06 3:28 
AnswerRe: Include Files and Folder Structure Pin
Chris Losinger16-Aug-06 3:32
professionalChris Losinger16-Aug-06 3:32 
AnswerRe: Include Files and Folder Structure Pin
Cedric Moonen16-Aug-06 3:32
Cedric Moonen16-Aug-06 3:32 
GeneralRe: Include Files and Folder Structure Pin
pgav16-Aug-06 3:33
pgav16-Aug-06 3:33 
GeneralRe: Include Files and Folder Structure Pin
Zac Howland16-Aug-06 3:36
Zac Howland16-Aug-06 3:36 
QuestionPasswordDerivedBytes How To? Pin
Gywox16-Aug-06 3:00
Gywox16-Aug-06 3:00 
QuestionHow to send double value as 8 uint8 values? Pin
cahit2316-Aug-06 2:55
cahit2316-Aug-06 2:55 

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.