MFC project

hello guys ,

i just start to bulid my first MFC project.
i wondring if this is the right place for this subject.
my gool is to create some GUI application that collect some information from the user such - name, Age etc... , save it into class object.
the class object process the recived data with some functions in the class and provid some additional information about the user.
my qustion is, how and where can i configure a new window for the resuts,
meaning once i click "Run" button i would like that my application will open a new window with the results inside.

please advice,
Elad
you build the window in visual studio, it has an editor where you can drag and drop things. You have to connect what you build back to the program, eg an edit box needs a variable so you can read / write to it with edit1->setwindowtext() type code. Once you have the window, you can just activate it with create window and show window etc calls to the window's class. I highly advise you to look at an example with multiple windows before you try to do this cold.

basically your code will have tiny changes; your 'run' button will compute some result, create the target window, do some sort of set window text type call to your target, and show the new window. 3 main lines of code. The bulk of the work will be setting up the window and connecting it to your code to be able to do that.

Windows take a bit to set up in the OS / gui level once your windows become more complex so I also advise you learn how to create it before you need it and use show/hide to control when the user sees it.

Last edited on
in addition ,
to start the process, the user should click "OK" button.
my App include few RadioButton and the proccess have to know which of the button was selected.
i have write nost of my code under "Ok" button but i wondring how can i get which button selected by the user.

thanks
From what I recall radio buttons can be queried to see if they are true or false; you need to call that for each one until you figure out which is set. Alternately you can give each button an on-event handler to do something. And there is a way to group the buttons together but I don't remember how it works. Sorry for lack of details, I haven't been coding gui for a while, but the good news is everything works the same handful of ways... for most gui items: you can poll it or you can have it trigger an event, and code accordingly.

My memory says that radio buttons were weird back in old MFC and you had to do getwindowitem to tap them (or set if you change them yourself). This may have been fixed seeing as how that was in 2005 or so.
Last edited on
Topic archived. No new replies allowed.