?
Solved

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

Posted on 2011-09-12
10
Medium Priority
?
244 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:norman1312
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 36524734
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
 
LVL 7

Expert Comment

by:tampnic
ID: 36526758
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
 
LVL 1

Expert Comment

by:philrosenberg
ID: 36528161
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 86

Expert Comment

by:jkr
ID: 36533562
Um, I thought that I even had recommended wxWidgets in my above comment ;o)
0
 

Author Comment

by:norman1312
ID: 36534260
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
 
LVL 1

Expert Comment

by:philrosenberg
ID: 36534483
Sorry jkr, obviously missed the last line of your reply. kudos to you
0
 
LVL 7

Expert Comment

by:tampnic
ID: 36535086
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
 

Author Comment

by:norman1312
ID: 36535177
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
 
LVL 40

Expert Comment

by:evilrix
ID: 37419282
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question