Solved

How to use IDC_EDIT objects from dialog box

Posted on 1998-11-08
1
1,552 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
[X]
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
1 Comment
 
LVL 1

Accepted Solution

by:
TheGrinch earned 20 total points
ID: 1324354
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

624 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