Click here to Skip to main content
15,884,177 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ofstream optimization problem Pin
doug2518-Jul-13 2:55
doug2518-Jul-13 2:55 
QuestionWin32 ListView control doesn't display any icons Pin
Jonathan Davies16-Jul-13 7:48
Jonathan Davies16-Jul-13 7:48 
QuestionRe: Win32 ListView control doesn't display any icons Pin
Randor 16-Jul-13 13:01
professional Randor 16-Jul-13 13:01 
AnswerRe: Win32 ListView control doesn't display any icons Pin
Jonathan Davies16-Jul-13 23:49
Jonathan Davies16-Jul-13 23:49 
AnswerRe: Win32 ListView control doesn't display any icons Pin
Richard MacCutchan16-Jul-13 20:59
mveRichard MacCutchan16-Jul-13 20:59 
GeneralRe: Win32 ListView control doesn't display any icons Pin
Jonathan Davies16-Jul-13 23:24
Jonathan Davies16-Jul-13 23:24 
GeneralRe: Win32 ListView control doesn't display any icons Pin
Richard MacCutchan17-Jul-13 1:33
mveRichard MacCutchan17-Jul-13 1:33 
GeneralRe: Win32 ListView control doesn't display any icons Pin
Jonathan Davies17-Jul-13 2:27
Jonathan Davies17-Jul-13 2:27 
Richard,
Stepped through it repeatedly, also side by side comparing it with working ATL/WTL example. I've just typed and run the below test at the end of the loop that fills rows with data where n is the loop variable. I get the LVITEM.iImage which is the index for the row, get a completely new ImageList from the ListView and get the icon from that ImageList successfully and can display it in the dialog top-left corner for any n.
C++
LVITEM lvItemP2;
SecureZeroMemory(&lvItemP2, sizeof(LVITEM));
lvItemP2.mask = LVIF_IMAGE;
lvItemP2.iItem = n;
BOOL bGotItem2 = ListView_GetItem(hList,  &lvItemP2);

HIMAGELIST hNewImageList =  ListView_GetImageList(hList, LVSIL_SMALL);
if(NULL == hNewImageList)
{
    DWORD dwErr = GetLastError();
    std::wstring szErr = CWin32ErrToWString()(dwErr);
    assert(!"Failed to get image list during test");
}

HICON hIconP2 = ImageList_GetIcon(hNewImageList, lvItemP2.iImage, ILD_NORMAL);
if(NULL == hIconP2)
{
    DWORD dwErr = GetLastError();
    std::wstring szErr = CWin32ErrToWString()(dwErr);
    assert(!"Failed to get icon from image list during test");
}
SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIconP2);

GeneralRe: Win32 ListView control doesn't display any icons Pin
Richard MacCutchan17-Jul-13 4:49
mveRichard MacCutchan17-Jul-13 4:49 
GeneralRe: Win32 ListView control doesn't display any icons Pin
Jonathan Davies17-Jul-13 6:42
Jonathan Davies17-Jul-13 6:42 
GeneralRe: Win32 ListView control doesn't display any icons Pin
Richard MacCutchan17-Jul-13 7:33
mveRichard MacCutchan17-Jul-13 7:33 
AnswerRe: Win32 ListView control doesn't display any icons Pin
Jonathan Davies18-Jul-13 0:19
Jonathan Davies18-Jul-13 0:19 
GeneralRe: Win32 ListView control doesn't display any icons Pin
Richard MacCutchan18-Jul-13 0:39
mveRichard MacCutchan18-Jul-13 0:39 
GeneralRe: Win32 ListView control doesn't display any icons Pin
Richard MacCutchan17-Jul-13 7:50
mveRichard MacCutchan17-Jul-13 7:50 
QuestionHow can make smooth horizontal scroll on ListControl?? Pin
Sun-Mi Kang14-Jul-13 21:21
Sun-Mi Kang14-Jul-13 21:21 
AnswerRe: How can make smooth horizontal scroll on ListControl?? Pin
Richard MacCutchan14-Jul-13 22:24
mveRichard MacCutchan14-Jul-13 22:24 
QuestionHow to use listview_insertgroup with custom draw? Pin
JoneLe8614-Jul-13 18:39
JoneLe8614-Jul-13 18:39 
QuestionRe: How to use listview_insertgroup with custom draw? Pin
Richard MacCutchan14-Jul-13 21:19
mveRichard MacCutchan14-Jul-13 21:19 
AnswerRe: How to use listview_insertgroup with custom draw? Pin
JoneLe8619-Jul-13 8:42
JoneLe8619-Jul-13 8:42 
Questionbeginner question... recursive function Pin
Member 1008957914-Jul-13 5:40
Member 1008957914-Jul-13 5:40 
AnswerRe: beginner question... recursive function Pin
Santhosh G_14-Jul-13 7:46
Santhosh G_14-Jul-13 7:46 
GeneralRe: beginner question... recursive function Pin
AlphaDeltaTheta14-Jul-13 17:40
AlphaDeltaTheta14-Jul-13 17:40 
GeneralRe: beginner question... recursive function Pin
Joe Woodbury15-Jul-13 10:43
professionalJoe Woodbury15-Jul-13 10:43 
GeneralRe: beginner question... recursive function Pin
Member 1008957916-Jul-13 6:33
Member 1008957916-Jul-13 6:33 
AnswerRe: beginner question... recursive function Pin
Erudite_Eric15-Jul-13 2:35
Erudite_Eric15-Jul-13 2:35 

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.