Click here to Skip to main content
15,905,148 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: try/catch Variable Scope Question Pin
palbano4-Aug-04 7:43
palbano4-Aug-04 7:43 
GeneralRe: try/catch Variable Scope Question Pin
Tim Smith4-Aug-04 15:26
Tim Smith4-Aug-04 15:26 
GeneralRe: try/catch Variable Scope Question Pin
Ryan Binns4-Aug-04 18:46
Ryan Binns4-Aug-04 18:46 
QuestionNewbie: Can I do this? Pin
cgriffin4-Aug-04 5:52
cgriffin4-Aug-04 5:52 
AnswerRe: Newbie: Can I do this? Pin
palbano4-Aug-04 7:16
palbano4-Aug-04 7:16 
AnswerRe: Newbie: Can I do this? Pin
digwizfox4-Aug-04 7:31
digwizfox4-Aug-04 7:31 
GeneralRe: Newbie: Can I do this? Pin
cgriffin4-Aug-04 7:45
cgriffin4-Aug-04 7:45 
GeneralRe: Newbie: Can I do this? Pin
digwizfox4-Aug-04 8:46
digwizfox4-Aug-04 8:46 
GeneralRe: Newbie: Can I do this? Pin
cgriffin4-Aug-04 10:10
cgriffin4-Aug-04 10:10 
GeneralRe: Newbie: Can I do this? Pin
digwizfox4-Aug-04 10:24
digwizfox4-Aug-04 10:24 
Generaliphelper Pin
Zizilamoroso4-Aug-04 4:24
Zizilamoroso4-Aug-04 4:24 
GeneralRe: iphelper Pin
David Crow4-Aug-04 4:30
David Crow4-Aug-04 4:30 
GeneralIStorage like functionality in memory Pin
pankajdaga4-Aug-04 4:14
pankajdaga4-Aug-04 4:14 
GeneralRe: IStorage like functionality in memory Pin
Chris Losinger4-Aug-04 5:28
professionalChris Losinger4-Aug-04 5:28 
GeneralRe: IStorage like functionality in memory Pin
pankajdaga4-Aug-04 6:49
pankajdaga4-Aug-04 6:49 
GeneralMenus in VC 7 not working after resource cleanup Pin
PrashantJ4-Aug-04 3:53
PrashantJ4-Aug-04 3:53 
GeneralRe: Menus in VC 7 not working after resource cleanup Pin
Tim Smith4-Aug-04 3:59
Tim Smith4-Aug-04 3:59 
GeneralRe: Menus in VC 7 not working after resource cleanup Pin
PrashantJ4-Aug-04 4:04
PrashantJ4-Aug-04 4:04 
GeneralUsing Created() CListBox Pin
gokings4-Aug-04 3:52
gokings4-Aug-04 3:52 
GeneralRe: Using Created() CListBox Pin
David Crow4-Aug-04 4:25
David Crow4-Aug-04 4:25 
My first question would be why are you creating it dynamically instead of making it part of the dialog template?

gokings wrote:
It is not clear to me what to do with it after it is created.

Add items to it, or perhaps I don't quite understand your question.

gokings wrote:
As far as I know, it does not have a DoModal() method as a CDialog object does or something analogous to the TrackPopupMenu() method of a CMenu object.

Why are you comparing it to a CDialog or CMenu object? A listbox is a control that is placed on a dialog and enables the user to choose one option from a list of possibilities.

gokings wrote:
Does anyone have an example Creating and displaying a CListBox?

It's such a common control that examples are everywhere. Search here at CP for starters, and then Google for even more.

gokings wrote:
I want the CListBox to "return" when the user makes a selection, and then to inquire of the CListBox which selection was made.

The analogy of "returning" when the user makes a selection makes no sense. When a selection is made from a listbox, the dialog will receive a LBN_SELCHANGE message. If you are using MFC, the dialog will need a ON_LBN_SELCHANGE handler instead. At that point, you can get the text and/or index of the currently selected item.


"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen


GeneralRe: Using Created() CListBox Pin
gokings4-Aug-04 5:24
gokings4-Aug-04 5:24 
GeneralRe: Using Created() CListBox Pin
David Crow4-Aug-04 5:58
David Crow4-Aug-04 5:58 
GeneralRe: Using Created() CListBox Pin
gokings5-Aug-04 22:08
gokings5-Aug-04 22:08 
GeneralRe: Using Created() CListBox Pin
cmk4-Aug-04 10:04
cmk4-Aug-04 10:04 
GeneralWindow size when dockingbar present Pin
_anil_4-Aug-04 3:44
_anil_4-Aug-04 3:44 

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.