Problems with List box in dynamically created dialog box 
Author Message
 Problems with List box in dynamically created dialog box

In my MFC-app I create a dialog box template in memory,
and use InitModalIndirect to initialize the dialog box.

This works fine for all controls except the List box. Even
though everything indicates that the list box is accepting
my strings, they don't show up in the list when I add them using
AddString.

The returned index is correct, and when I test the GetCount
function of the list box it returns the correct number. THE
STRINGS JUST DOESN'T SHOW UP IN THE LIST.

I must admit I'm very puzzled. I thought it might have to do
with how I add the list box to my template. I use the combination
of 0xFFFF and 0x0083 to indicate the list box class, and the
following style:

WS_CHILD | WS_BORDER | WS_GROUP | WS_TABSTOP | WS_VISIBLE |
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY | DS_3DLOOK

I can not find any peculiarities here, so I am wondering whether
MFC is doing some strange initialisation of the list boxes that
I am unaware of.

I'd be thankful for any response

P?l K. T?nder



Fri, 03 Dec 1999 03:00:00 GMT  
 Problems with List box in dynamically created dialog box

Quote:
>I use the combination of 0xFFFF and 0x0083 to indicate the list box class

Curious, why do you do that? The class is the name "LISTBOX" - isn't
it?

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.
http://www.bj.co.uk



Sat, 04 Dec 1999 03:00:00 GMT  
 Problems with List box in dynamically created dialog box

Quote:

> >I use the combination of 0xFFFF and 0x0083 to indicate the list box class

> Curious, why do you do that? The class is the name "LISTBOX" - isn't
> it?

> Dave
> ----
> Address is altered to discourage junk mail.
> Remove ".---" for the real address.
> http://www.bj.co.uk

I do this because it is easier than adding "LISTBOX" in Unicode to
the global memory as would otherwise be required. Also, the Online
help indicates that this should give the same result. This
approach is successfully used for other controls given the values in
the following list:

0x0080  Button
0x0081  Edit
0x0082  Static
0x0083  List box
0x0084  Scroll bar
0x0085  Combo box

This works for all controls except the list box.

P?l K. T?nder



Sun, 05 Dec 1999 03:00:00 GMT  
 Problems with List box in dynamically created dialog box

Quote:
> Also, the Online
>help indicates that this should give the same result. This
>approach is successfully used for other controls given the values in
>the following list:

>0x0080      Button
>0x0081      Edit
>0x0082      Static
>0x0083      List box
>0x0084      Scroll bar
>0x0085      Combo box

I wasn't aware of this, but now I am. Since you do create a (not
completely working) ListBox, presumably the problem is more to do with
the style of the control. Have you checked the style flags using Spy++
against a working list box?

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.
http://www.bj.co.uk



Sun, 05 Dec 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Problems with List box in dynamically created dialog box

2. dynamically modifying a dialog list box

3. i cannot add an item to my list box that is located within my dialog box

4. List boxes in Modal Dialog Box

5. Disabling editing of list box items in the file open dialog box

6. Transfer of data from an edit box in one dialog box to a list box in another dialog box II

7. Modeless dialog box together with modal dialog box

8. Q: how to put a drop down in a list box dynamically

9. activating a button on a dialog box from a dialog box

10. problem creating dialog box

11. Dialog box in a dialog box

12. transfer data from one dialog box to another dialog box

 

 
Powered by phpBB® Forum Software