Solved

CEdit: Getting a line of text...

Posted on 1998-08-12
3
406 Views
Last Modified: 2013-11-20
I am new to MFC and I am using ClassWizard to make an application.  I know how to receive text from a CEdit
object using SetSel, and then GetLine when I am creating and destroying everything myself.  But, when I use classWizard, I am not sure how to get a pointer to the two CEdit boxes that are in my application.
Thanks very much for your time.
0
Comment
Question by:bass_glen
3 Comments
 
LVL 2

Accepted Solution

by:
SamratAshok earned 50 total points
Comment Utility
You can write code to get window pointers using class wizard. You can use function the
GetDlgItem(int idofControl) function to obtain the pointer though. In most cases, you have
to cast the return value to something more useful.

Refer to documentation on GetDlgItem function for more info.
0
 
LVL 9

Expert Comment

by:Priyesh
Comment Utility
Please make it specific where u have Edit boxes?? Did u create them? or are they in a dialog??
If they are in a dialog, use CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1) ;
provided IDC_EDIT1 is the id of u'r edit box....
      Regards..
0
 

Author Comment

by:bass_glen
Comment Utility
Yes, after casting it to a CEdit, I had no problem getting the data from the CEdit box.  Thanks very much.  I really appreciate your help.  Sorry it took me so long to get back, I had to try it out first and make sure that I could figure out what was going on.
Thanks again.
-GLEN...
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This video discusses moving either the default database or any database to a new volume.

763 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

8 Experts available now in Live!

Get 1:1 Help Now