Re: HTREEITEM
- From: Al <Al@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 9 Mar 2008 14:19:23 -0700
I was trying to illustrate what I wanted to do. I guess with a bad
illustration. What I am trying to do is; there will be a user list which I
don't know the length. I want to delcare a HTREEITEM for each item of the
list so that I can add sub items to these items. Not knowing how long that
list will be makes it quit hard to declare these items before it is running.
Is there a way to delcare HTREEITEMS during execution and how do I declar
them with some kind of sanity towards the list items?
Thanks
--
Just Al
"Joseph M. Newcomer" wrote:
An HTREEITEM is a "handle", and as such you could not possibly assign a name to it. An.
HTREEITEM is a bag-o'-bits that you use to retrieve a tree item. A string is text.
Besides not being able to write the code shown below (which makes no sense, because 'name'
is already declared as one type, and you can't declare it again; you might as well write
DWORD x;
double x;
int x;
and you will get the same error), there is no possible way to assign a string to a tree
item handle.
Try to avoid commas in declaration lists. One variable, one declaration
CString name;
CString num;
would be the tasteful way to declare the variables. Pretend you never heard of any
syntactic rule that allows commas in variable declarations. The result will be cleaner
code.
Please explain the problem you are trying to solve.
joe
On Sun, 9 Mar 2008 12:36:01 -0700, Al <Al@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Is there a way to declare a HTREEITEM from a CString value so that I can add****
to the tree when application is in use?
CString name, num;
num = _T("0");
name = _T("Item");
name = name + num;
This could be written as
name += num;
****
HTREEITEM name; // is there a way to do thisJoseph M. Newcomer [MVP]
I know that this doesn't work. Any ideas?
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Follow-Ups:
- Re: HTREEITEM
- From: Joseph M . Newcomer
- Re: HTREEITEM
- From: Somebody
- Re: HTREEITEM
- From: Dan Bloomquist
- Re: HTREEITEM
- References:
- Re: HTREEITEM
- From: Joseph M . Newcomer
- Re: HTREEITEM
- Prev by Date: Re: How would you update this array? Help with logic.
- Next by Date: Re: HTREEITEM
- Previous by thread: Re: HTREEITEM
- Next by thread: Re: HTREEITEM
- Index(es):
Relevant Pages
|
|