|
-
November 26th, 2007, 07:15 AM
#1
Create ListBox,
Hallo,
Now I want to create a ListBox by using this command
hwndListBox = CreateWindow(ListBox, NULL, WS_CHILD | LBS_DISABLENOSCROLL | LBS_NOTIFY | WS_BORDER, x, 8, 70, 18, m_hwnd, NULL, g_hInst, NULL);
But then I received this error:
error C2065: 'ListBox' : undeclared identifier
I already changed ListBox to _T("ListBox") but it also didn't work, no error but no ListBox was created
Does anyone know which word is correct for my case? I am searching for many hours but I could not find it.
I do not use MFC and my Character Set is Unicode.
Thank you very much for any help
-
November 26th, 2007, 07:25 AM
#2
Re: Create ListBox,
I don't know why it does not work for you. Maybe it would work with the name in lower case. Here is an example I have used successfully:
Code:
fname_hwnd = CreateWindow("listbox", "Foo",
WS_CHILD | WS_VISIBLE | WS_TABSTOP
| LBS_NOTIFY
| WS_VSCROLL | WS_BORDER,
rect.left, rect.top,
rect.right - rect.left,
rect.bottom - rect.top,
hwnd, (HMENU)(LSTBOX_FOONAME_ID),
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
-
November 26th, 2007, 07:44 AM
#3
Re: Create ListBox,
thank you very much, I don't know too, but I tried in the way you showed me, and it still didn't work 
hwndListBox = CreateWindow(_T("listbox"), _T("foo"), WS_CHILD | LBS_DISABLENOSCROLL | LBS_NOTIFY | WS_BORDER, x, 8, 70, 18, m_hwnd, NULL, g_hInst, NULL);
-
November 26th, 2007, 08:57 AM
#4
Re: Create ListBox,
Define didn't work. Compilation error? Runtime error?
-
November 26th, 2007, 10:57 AM
#5
Re: Create ListBox,
 Originally Posted by Marc G
Define didn't work. Compilation error? Runtime error?
I already knew what happened to my code, this was my mistake, olivthill was correct, the last time I forgot WS_VISIBLE, that's why it didn'T work.
Thank you for all of your help.
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
|