Click here to Skip to main content
15,900,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Stack overflow Pin
RomTibi9-Dec-07 7:29
RomTibi9-Dec-07 7:29 
GeneralRe: Stack overflow Pin
Mark Salsbery9-Dec-07 7:45
Mark Salsbery9-Dec-07 7:45 
GeneralRe: Stack overflow Pin
RomTibi9-Dec-07 20:56
RomTibi9-Dec-07 20:56 
GeneralRe: Stack overflow Pin
Mark Salsbery10-Dec-07 7:20
Mark Salsbery10-Dec-07 7:20 
GeneralRe: Stack overflow Pin
RomTibi10-Dec-07 8:38
RomTibi10-Dec-07 8:38 
QuestionHow to Find out what was selected in Combo Box Pin
Larry Mills Sr9-Dec-07 4:28
Larry Mills Sr9-Dec-07 4:28 
AnswerRe: How to Find out what was selected in Combo Box Pin
Hamid_RT9-Dec-07 6:25
Hamid_RT9-Dec-07 6:25 
AnswerRe: How to Find out what was selected in Combo Box Pin
Mark Salsbery9-Dec-07 7:09
Mark Salsbery9-Dec-07 7:09 
When the user changes the selected item, the parent will receive a CBN_SELCHANGE
notification (in a WM_COMMAND message). In response to that notification,
or at some other time you need the selected item from the combo box, you
could do something like this:
LRESULT SelectedIndex = SendMessage(hwndComboBox, CB_GETCURSEL, 0, 0);
if (CB_ERR != SelectedIndex)
{
    LRESULT StringLength = SendMessage(hwndComboBox, CB_GETLBTEXTLEN, SelectedIndex, 0); 
    TCHAR *pSelectedString = new TCHAR[StringLength + 1];
    SendMessage(hwndComboBox, CB_GETLBTEXT, SelectedIndex, (LPARAM)pSelectedString);
    //...
    //... do something with the string ...
    //...
    delete[] pSelectedString;
}


All Windows controls have associated messages used to manipulate them. Unless you
have them all memoized, I recommend keeping a link to this: Windows Controls[^]
or know where to find it in your local documentation.


Mark Salsbery
Microsoft MVP - Visual C++


Java | [Coffee]

AnswerRe: How to Find out what was selected in Combo Box Pin
ddspliting10-Dec-07 6:53
ddspliting10-Dec-07 6:53 
GeneralFrom Mpeg-2 to Vob Pin
mjmim9-Dec-07 3:59
mjmim9-Dec-07 3:59 
Answerabout const member function Pin
clj198705039-Dec-07 1:07
clj198705039-Dec-07 1:07 
GeneralRe: about const member function Pin
super_ttd9-Dec-07 2:51
super_ttd9-Dec-07 2:51 
GeneralRe: about const member function Pin
Steen Krogsgaard9-Dec-07 22:29
Steen Krogsgaard9-Dec-07 22:29 
Questionproblem in code running on msvs2008 c++ while same logic runs fine on turbo c++ 3.0 Pin
ashjas8-Dec-07 23:27
ashjas8-Dec-07 23:27 
GeneralRe: problem in code running on msvs2008 c++ while same logic runs fine on turbo c++ 3.0 Pin
ashjas8-Dec-07 23:33
ashjas8-Dec-07 23:33 
GeneralRe: problem in code running on msvs2008 c++ while same logic runs fine on turbo c++ 3.0 Pin
normanS9-Dec-07 0:53
normanS9-Dec-07 0:53 
GeneralRe: problem in code running on msvs2008 c++ while same logic runs fine on turbo c++ 3.0 Pin
markkuk9-Dec-07 2:18
markkuk9-Dec-07 2:18 
GeneralRe: problem in code running on msvs2008 c++ while same logic runs fine on turbo c++ 3.0 Pin
ashjas9-Dec-07 4:15
ashjas9-Dec-07 4:15 
Questionfind error Pin
keyto8-Dec-07 20:08
keyto8-Dec-07 20:08 
GeneralRe: find error Pin
David Crow14-Mar-08 6:00
David Crow14-Mar-08 6:00 
GeneralDialogBox question Pin
KellyR8-Dec-07 8:47
KellyR8-Dec-07 8:47 
GeneralRe: DialogBox question Pin
Mark Salsbery8-Dec-07 9:25
Mark Salsbery8-Dec-07 9:25 
GeneralRe: DialogBox question Pin
KellyR8-Dec-07 9:37
KellyR8-Dec-07 9:37 
GeneralGDI+ trailing spaces and newline Pin
bob169728-Dec-07 5:59
bob169728-Dec-07 5:59 
GeneralWindow Styles Pin
Giorgi Dalakishvili8-Dec-07 4:32
mentorGiorgi Dalakishvili8-Dec-07 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.