|
-
January 17th, 2007, 12:42 PM
#1
How to create a CListBox array?
HI,
I use C++ MFC in Visual Studio, in the program header, I create a CListView variable by
CListBox m_list[6];
As m_list is only a pointer and not an actual variable,
Then in the program, I try to initialize each by
m_list[0] = new CListBox;
But it fail to compile and show an error message as
binary '=' : no operator found which takes a right-hand operand of type 'CListBox *' (or there is no acceptable conversion)
But if I don't initialize each and save data to it by
m_list[0].AddString("Test");
it will certain break the program when it run.
So how could i initialize it?
Beside, is there any CListBox member to clear all its content immediately? do I need to clear one string by one string in the CListBox
Thanks in advance!!!
Martin
-
January 17th, 2007, 12:47 PM
#2
Re: How to create a CListBox array?
As m_list is only a pointer and not an actual variable,
Then in the program, I try to initialize each by
no it isn't, but this is:
Code:
CListBox *m_list[6];
Your problem is the fact that you don't create the CListBox:
Code:
m_list[0].Create (bla, bla, bla);
Beside, is there any CListBox member to clear all its content immediately? do I need to clear one string by one string in the CListBox.
Code:
m_list[0].ResetContent ();
Last edited by Skizmo; January 17th, 2007 at 12:51 PM.
-
January 17th, 2007, 12:53 PM
#3
Re: How to create a CListBox array?
Thanks for all you guys!
Have a nice day!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|