Solved

CEdit: Getting a line of text...

Posted on 1998-08-12
3
448 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
string initialization in java 11 115
child constructor and parent constructor, overriding and overloading 6 89
MaxSpan challenge 9 109
I could not set window to top 4 23
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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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