Solved

CEdit: Getting a line of text...

Posted on 1998-08-12
3
421 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
ID: 1320697
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
ID: 1320698
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
ID: 1320699
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 172
iSeries DB2 Query 2 89
post4 challenge 28 92
fix34  challenge 9 104
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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 is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

932 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

10 Experts available now in Live!

Get 1:1 Help Now