list boxes

I

ian

hello all
im currently learning windows programming
im having trouble adding text to a combo list box

im using the following with visual studio

HWND hwndList = GetDlgItem(hWnd, IDC_LIST);
SendMessage(hwndList,CB_ADDSTRING,100,(LPARAM)(LPCSTR)"Pencil");
SendMessage(hwndList,CB_SETCURSEL,0,0);

can anyone tell me what im doing wrong
cheers
 
M

Mike Wahler

ian said:
hello all
im currently learning windows programming
im having trouble adding text to a combo list box

im using the following with visual studio

HWND hwndList = GetDlgItem(hWnd, IDC_LIST);
SendMessage(hwndList,CB_ADDSTRING,100,(LPARAM)(LPCSTR)"Pencil");
SendMessage(hwndList,CB_SETCURSEL,0,0);

can anyone tell me what im doing wrong
cheers

Answers available at newsgroup:

comp.os.ms-windows.programmer.win32

and/or

microsoft.public.win32.programmer.ui

Purpose of newsgroup comp.lang.c++ :

http://www.slack.net/~shiva/welcome.txt

-Mike
 
A

Andre Kostur

hello all
im currently learning windows programming
im having trouble adding text to a combo list box

im using the following with visual studio

HWND hwndList = GetDlgItem(hWnd, IDC_LIST);
SendMessage(hwndList,CB_ADDSTRING,100,(LPARAM)(LPCSTR)"Pencil");
SendMessage(hwndList,CB_SETCURSEL,0,0);

can anyone tell me what im doing wrong

Well... you're asking in the wrong place. comp.lang.c++ is for discussing
the Standard C++ language, which has no concept of Windows or combo boxes.
You'd be better off asking in a Microsoft newsgrop dedicated to Win32 API
programming.
 
V

Victor Bazarov

ian said:
hello all
im currently learning windows programming
im having trouble adding text to a combo list box
[...]
can anyone tell me what im doing wrong

Yes. You're posting to a wrong newsgroup. This one is about
C++ language, you need comp.os.ms-windows.programmer.

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top