what can vc++ express do for input of win32 application?

I have now converted part of a program originally written for Borland Turbo C (using OWL) to a M$ Visual C++ 2010 Express win32 application (NOT a console application).
I can now display the initial information in the window, but am trying to understand just how far I can go to be able to input data to the program. As it doesn't have MFC this may be a problem. The original program used dialog boxes to be able to add new data to the existing information.
As it doesn't have Resource Editing either this could be tricky, but I have the resource files from the original code. I can even display the boxes in VC++ 2010, but don't see how to populate them or read back any information.
Any advice or suggestions on how to procede next would be greatly appreciated.
norman1312Asked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
You can use Windows' APIs to obtain user inpute, e.g. 'GetDlgItemText()' (http://msdn.microsoft.com/en-us/library/ms645489%28VS.85%29.aspx) etc. This a bit more tedious than using a GUI library, yet still works. For an example, see e.g. http://msdn.microsoft.com/en-us/library/ms644996%28VS.85%29.aspx ("Using Dialog Boxes").

BTW, if you are looking for a GUI library, I'd suggest wxWidgets: http://wxwidgets.org/
0
 
tampnicCommented:
jkr has answered your question about getting data into and out of dialog boxes..

As an aside, for your dialog editing needs http://www.resedit.net/ will let you edit your dialogs graphically. Its what I used to use before I upgraded from Express to the full version of Visual Studio. Just set up the include paths in the preferences to point to the headers in your Visual Studio installation, then open your rc file.

HTH,
  Chris
0
 
philrosenbergCommented:
As tampnic said jkr has answered your question about dialog boxes, however if you are interested you could make use of the wxWidgets library. This is an open source, cros platform free library which includes features from one line functions to generate massageboxes, input boxes, file selection dialogs etc all the way up to designing multiple frame applications. There is a windows installer available from http://wxpack.sourceforge.net/ which will add a wxWidgets project into VC++ Express. giving you a starting point and tutorials are all over the web.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
jkrCommented:
Um, I thought that I even had recommended wxWidgets in my above comment ;o)
0
 
norman1312Author Commented:
Well so far I've been able to generate and populate a dialog box (without using any other tool). Next is to catch the OK/Cancel response so I know what to do when the window closes. So I'm hoping I won't need to use wxWidgets (we shall see). After that is trying to work out the code to populate/check a radio button.
Old story, I know what I want to do (have done in other language) but frustrated there is no simple primer on basic (!) GUI functionality.
0
 
philrosenbergCommented:
Sorry jkr, obviously missed the last line of your reply. kudos to you
0
 
tampnicCommented:
In the message procedure for your dialog box (this is a callback function which is set when you create the dialog), you will need to handle the WM_COMMAND message. Here's a snippet which is part of a Windows app I wrote a few months ago - showing where I handle IDOK and IDCANCEL in the message switch block.

 
case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                case IDOK:
                    sqlite3_exec(App->getDB(), "COMMIT", 0, 0, 0);
                    EndDialog(hwndDlg, 0);
                    return TRUE;
                 case IDCANCEL:
                    sqlite3_exec(App->getDB(), "ROLLBACK", 0, 0, 0);
                    EndDialog(hwndDlg, 0);
                    return TRUE;
            }

Open in new window


jkr has answered your original question and should get the points - you might want to open a new question for this.

Cheers,
  Chris



0
 
norman1312Author Commented:
Actually I've just worked it out myself. Thanks anyway.
Still on input, I'm trying to set and read which of two radio buttons is set, but my old code uses CheckRadioButton and that doesn't seem to work. What should I be using?
0
 
evilrixSenior Software Engineer (Avast)Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.