Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-09-12
10
236 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
10 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

790 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