Solved

How to use IDC_EDIT objects from dialog box

Posted on 1998-11-08
1
1,527 Views
Last Modified: 2013-11-20
I have created a dialog box to pop up on the creation of a new document.  The box has IDC_EDIT objects to enter the names of the 2 players of the game.  How can I access the IDC_EDIT1 and IDC_EDIT2?  I want to perhaps convert them to strings for use with my program.

Thanks,
0
Comment
Question by:Mephisto
1 Comment
 
LVL 1

Accepted Solution

by:
TheGrinch earned 20 total points
Comment Utility
Use ClassWizard. Select your dialog class.

Click the member variables tab. Highlight each of the IDC_EDIT items and click "Add Variable". Add a variable of category "Value" and type "CString" with a name of your choosing.

Now, invoke your dialog with ...DoModal(). When DoModal() returns the variables will contain the data entered (if "OK" was clicked).

Note: DoModal returns IDOK if OK is clicked, or IDCANCEL if CANCEL was clicked. In the latter case the variables won't be set.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now