473,569 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List Control, ImageList

11 New Member
I am using MFC in Visual Studio 2005.

I had added a list control in my dialog and set the view property as "Icon". I declared the ImageList in the OnInitDialog of the dialog where the listview is displayed. The dialog is supposed to open when I clicked a button from the main dialog. However, I keep on getting this problem which I guess is due to the hWnd = 0x00000000.

m_ListView {CListCtrl hWnd=0x00000000 } CListCtrl


Part of my code:

BOOL CSoccerControl: :OnInitDialog()
{
CDialog::OnInit Dialog();
.
.
.
m_pImageList = new CImageList(); //I had declared m_pImageList in the header file using CImageList *m_pImageList;

//Create, initialize, and hook up image list
m_pImageList->Create(32,32,T RUE,1,1);
m_pImageList->Add(AfxGetApp( )->LoadIconA(IDI_ TEST));
this->m_ListView.Set ImageList(m_pIm ageList, LVSIL_NORMAL);

return TRUE;
}

Compiler shows problem occurs here:

{ ASSERT(::IsWind ow(m_hWnd)); return CImageList::Fro mHandle((HIMAGE LIST)
::SendMessage(m _hWnd, LVM_SETIMAGELIS T, nImageList, (LPARAM)pImageL ist->GetSafeHandle( ))); }


From the call stack:

mfc80d.dll!CLis tCtrl::SetImage List(CImageList * pImageList=0x00 35b250, int nImageList=0) Line 138 + 0x2b bytes C++
Humanoid_GUI.ex e!CSoccerContro l::OnInitDialog () Line 136 C++
mfc80d.dll!AfxD lgProc(HWND__ * hWnd=0x000e0218 , unsigned int message=272, unsigned int __formal=786840 , unsigned int __formal=786840 ) Line 28 + 0x10 bytes C++
user32.dll!7e41 8734()
[Frames below may be incorrect and/or missing, no symbols loaded for user32.dll]
user32.dll!7e42 3b9c()
user32.dll!7e42 3591()
user32.dll!7e43 e53f()
user32.dll!7e41 84fc()
user32.dll!7e41 85a4()
user32.dll!7e43 e561()
user32.dll!7e41 8734()
user32.dll!7e43 e53f()
user32.dll!7e43 e53f()
user32.dll!7e41 8816()
user32.dll!7e43 e53f()
user32.dll!7e43 e53f()
ntdll.dll!7c912 c99()
user32.dll!7e41 c63f()
user32.dll!7e43 e53f()
user32.dll!7e41 f65d()
user32.dll!7e43 e53f()
mfc80d.dll!CWnd ::DefWindowProc A(unsigned int nMsg=272, unsigned int wParam=786840, long lParam=0) Line 1029 + 0x20 bytes C++
mfc80d.dll!CWnd ::Default() Line 274 C++
mfc80d.dll!CDia log::HandleInit Dialog(unsigned int __formal=786840 , unsigned int __formal=786840 ) Line 633 + 0x8 bytes C++
mfc80d.dll!CWnd ::OnWndMsg(unsi gned int message=272, unsigned int wParam=786840, long lParam=0, long * pResult=0x0012f 070) Line 2004 + 0x11 bytes C++
mfc80d.dll!CWnd ::WindowProc(un signed int message=272, unsigned int wParam=786840, long lParam=0) Line 1741 + 0x20 bytes C++
mfc80d.dll!AfxC allWndProc(CWnd * pWnd=0x0035a910 , HWND__ * hWnd=0x000e0218 , unsigned int nMsg=272, unsigned int wParam=786840, long lParam=0) Line 240 + 0x1c bytes C++
mfc80d.dll!AfxW ndProc(HWND__ * hWnd=0x000e0218 , unsigned int nMsg=272, unsigned int wParam=786840, long lParam=0) Line 389 C++
mfc80d.dll!AfxW ndProcBase(HWND __ * hWnd=0x000e0218 , unsigned int nMsg=272, unsigned int wParam=786840, long lParam=0) Line 407 + 0x15 bytes C++
user32.dll!7e41 8734()
user32.dll!7e41 8816()
user32.dll!7e41 b89b()
user32.dll!7e42 43e0()
user32.dll!7e42 4704()
user32.dll!7e43 9b0b()
mfc80d.dll!CWnd ::CreateDlgIndi rect(const DLGTEMPLATE * lpDialogTemplat e=0x00a6a160, CWnd * pParentWnd=0x00 12fe3c, HINSTANCE__ * hInst=0x0040000 0) Line 307 + 0x2a bytes C++
mfc80d.dll!CDia log::DoModal() Line 536 + 0x20 bytes C++
Humanoid_GUI.ex e!CHumanoid_GUI Dlg::OnBnClicke dButtonSoccer() Line 264 + 0x12 bytes C++
mfc80d.dll!_Afx DispatchCmdMsg( CCmdTarget * pTarget=0x0012f e3c, unsigned int nID=1006, int nCode=0, void (void)* pfn=0x00425541, void * pExtra=0x000000 00, unsigned int nSig=56, AFX_CMDHANDLERI NFO * pHandlerInfo=0x 00000000) Line 82 C++
mfc80d.dll!CCmd Target::OnCmdMs g(unsigned int nID=1006, int nCode=0, void * pExtra=0x000000 00, AFX_CMDHANDLERI NFO * pHandlerInfo=0x 00000000) Line 381 + 0x27 bytes C++
mfc80d.dll!CDia log::OnCmdMsg(u nsigned int nID=1006, int nCode=0, void * pExtra=0x000000 00, AFX_CMDHANDLERI NFO * pHandlerInfo=0x 00000000) Line 85 + 0x18 bytes C++
mfc80d.dll!CWnd ::OnCommand(uns igned int wParam=1006, long lParam=1048948) Line 2300 C++
mfc80d.dll!CWnd ::OnWndMsg(unsi gned int message=273, unsigned int wParam=1006, long lParam=1048948, long * pResult=0x0012f 800) Line 1755 + 0x1e bytes C++
mfc80d.dll!CWnd ::WindowProc(un signed int message=273, unsigned int wParam=1006, long lParam=1048948) Line 1741 + 0x20 bytes C++
mfc80d.dll!AfxC allWndProc(CWnd * pWnd=0x0012fe3c , HWND__ * hWnd=0x000e020e , unsigned int nMsg=273, unsigned int wParam=1006, long lParam=1048948) Line 240 + 0x1c bytes C++
mfc80d.dll!AfxW ndProc(HWND__ * hWnd=0x000e020e , unsigned int nMsg=273, unsigned int wParam=1006, long lParam=1048948) Line 389 C++
mfc80d.dll!AfxW ndProcBase(HWND __ * hWnd=0x000e020e , unsigned int nMsg=273, unsigned int wParam=1006, long lParam=1048948) Line 407 + 0x15 bytes C++
user32.dll!7e41 8734()
user32.dll!7e41 8816()
user32.dll!7e41 b4c0()
user32.dll!7e41 b89b()
user32.dll!7e41 b903()
user32.dll!7e44 fd1d()
user32.dll!7e44 6561()
user32.dll!7e42 6df4()
mfc80d.dll!AfxG etThread() Line 137 + 0x5 bytes C++
mfc80d.dll!CWin Thread::Process MessageFilter(i nt code=0, tagMSG * lpMsg=0x0003001 d) Line 850 + 0x5 bytes C++
00000202()
user32.dll!7e43 affe()
user32.dll!7e41 8734()
user32.dll!7e43 affe()
user32.dll!7e43 affe()
user32.dll!7e41 8816()
user32.dll!7e43 affe()
user32.dll!7e41 f805()
user32.dll!7e41 89cd()
user32.dll!7e43 affe()
user32.dll!7e43 1b3c()
user32.dll!7e41 8a10()
user32.dll!7e42 d99d()
user32.dll!7e43 c69b()
mfc80d.dll!CWnd ::IsDialogMessa geA(tagMSG * lpMsg=0x0015419 8) Line 198 C++
mfc80d.dll!CWnd ::PreTranslateI nput(tagMSG * lpMsg=0x0015419 8) Line 4268 C++
mfc80d.dll!CDia log::PreTransla teMessage(tagMS G * pMsg=0x00154198 ) Line 80 C++
mfc80d.dll!CWnd ::WalkPreTransl ateTree(HWND__ * hWndStop=0x000e 020e, tagMSG * pMsg=0x00154198 ) Line 2882 + 0x14 bytes C++
mfc80d.dll!AfxI nternalPreTrans lateMessage(tag MSG * pMsg=0x00154198 ) Line 233 + 0x12 bytes C++
mfc80d.dll!CWin Thread::PreTran slateMessage(ta gMSG * pMsg=0x00154198 ) Line 773 + 0x9 bytes C++
mfc80d.dll!AfxP reTranslateMess age(tagMSG * pMsg=0x00154198 ) Line 252 + 0x11 bytes C++
mfc80d.dll!AfxI nternalPumpMess age() Line 178 + 0x18 bytes C++
mfc80d.dll!CWin Thread::PumpMes sage() Line 896 C++
mfc80d.dll!AfxP umpMessage() Line 190 + 0xd bytes C++
mfc80d.dll!CWnd ::RunModalLoop( unsigned long dwFlags=4) Line 4322 + 0x5 bytes C++
mfc80d.dll!CDia log::DoModal() Line 544 + 0xc bytes C++
Humanoid_GUI.ex e!CHumanoid_GUI App::InitInstan ce() Line 58 + 0xb bytes C++
mfc80d.dll!AfxW inMain(HINSTANC E__ * hInstance=0x004 00000, HINSTANCE__ * hPrevInstance=0 x00000000, char * lpCmdLine=0x001 51f3f, int nCmdShow=1) Line 37 + 0xd bytes C++
Humanoid_GUI.ex e!WinMain(HINST ANCE__ * hInstance=0x004 00000, HINSTANCE__ * hPrevInstance=0 x00000000, char * lpCmdLine=0x001 51f3f, int nCmdShow=1) Line 29 C++
Humanoid_GUI.ex e!__tmainCRTSta rtup() Line 578 + 0x35 bytes C
Humanoid_GUI.ex e!WinMainCRTSta rtup() Line 403 C
kernel32.dll!7c 816fd7()

What should I do to avoid the problem?
Dec 17 '07 #1
0 1772

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1908
by: Curtis Wellborn | last post by:
Hey, I was wondering if there is any way in the designer to put my Icons(which i have 200 in three different folders) into an ImageList with out doing it one by one in the add image. This will take me forever and I dont know the capacity of the imageList so it could also be a waste of time. If anyone can help please let me know. Restate...
1
3037
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! Can any one point me in direction of modify a TextBox control. What i want to do is to add a button, like the ComboBox have. with my own bitmap and execute an Event when clicked. I will use this to bring a lookup table when searching for customers.
1
2250
by: Webster | last post by:
Hello, I created a User Control consisting of a TreeView and an ImageList. I've populated the ImageList with pictures (design-time using the Properties Window), and I've added some Nodes to the TreeView setting certain Nodes to different graphics from the ImageList (once again at design-time). The problem is, when I add the User Control...
3
1326
by: Bernie Yaeger | last post by:
I'm trying to add different images to the nodes and subnodes of a tree list. I would like the primary nodes to display one image and the secondary nodes several different images, and then, of course, be able to 'open' or 'close' those with second images for each representing 'open' or 'closed'. When I try to do this, I can't seem to get beyon...
7
1261
by: Jm | last post by:
Hi All Is there a way to have multiple list views created during program runtime in code, which can have objects added, removed and later on the listview itself be removed, whilst keeping the previous listview(s) hidden or disabled under the original ? Thanks
0
3221
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another way... here is my code on how I did it to help anyone starting out get an idea of how to use virtual mode in ..NET 2.0 Imports...
6
1587
by: eso40043 | last post by:
Hello, I am a newbie at python, as will shortly become painfully apparent. I wrote some code that goes through a list of file names that contain names of stars. I put the star names in 'tgtnamelist'. The corresponding file names are in 'imagelist'. 'imagelist' and 'tgtnamelist' have the same length. 'tgtnamelist' does not contain...
0
1432
by: Ryan Liu | last post by:
Hi, I have this inconsistent problem for days and really get me exhausted. I have a user control with a datagrid, a small toolbar, a label and a text box on it. Toolbar has buttons to highlight all rows, delete rows. Label and TextBox is to show line count.
0
2167
by: Phil Stanton | last post by:
I am using an imageList control for a tree menu. Works fine Problem I have is using VB to populate the ImageList Basically I have a table of Icons that I wish to use. They point to a folder where I store the Icon images. The name of the ImageList is ImList. The LoadPicture routine finds the full path of the Icon, and obviously I want to...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.