Re: HTREEITEM



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 this

I know that this doesn't work. Any ideas?
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

.



Relevant Pages

  • Re: Multiple problems with a running job
    ... -- Basically we have a bunch of spares lists, where the lists are made up of ... segments, and each segment is made up of materials. ... DECLARE @Project_Number char ... OPEN SparesListMaterialCursor ...
    (microsoft.public.sqlserver.programming)
  • Re: how to speed up some lisp code?
    ... >> representing these as lists. ... declare the variables to be FIXNUM. ...
    (comp.lang.lisp)
  • Re: Static/Strong/Implicit Typing
    ... >> accept both lists and vectors. ... >> arithmetic functions. ... > You could if the functions had multiple versions, and the compiler inserted ... code wanted a static declaration and the programmer chose to declare it ...
    (comp.lang.lisp)
  • Re: static typing
    ... I would like to be able to declare a type like list ... First, if you're processing lists, you shouldn't use NULL, CONS, CAR or CDR! ... The public API for list processing is ENDP, LIST, FIRST and REST. ... A general library of Lisp 'linting' utilities might be very useful. ...
    (comp.lang.lisp)
  • Re: how to speed up some lisp code?
    ... > The integers in the lists are small: ... I was hoping that since I could use arithmetic operations ... declare the variables to be FIXNUM. ... Make sure you declare all the temporary variables as well. ...
    (comp.lang.lisp)