0

I'm trying to create a simple program, if you can even call it that.

It has a main dialog and inside an edit box/control thing. picture

When I try to debug (I'm using MS Visual Studio 2013) I get the "I-beam" (the flashing text-thing pointer) but I can't input any text. picture

Questions: Why? How to fix?

Also, later on I want to try writing the inputted text into a txt file. I've tried searching for it, and found that you have to use the string method... Beyond that I could not understand the explanations ;(

CODE:

void Cedit2textDlg::OnEnChangeEdit1()
{
// TODO:  If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialogEx::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO:  Add your control notification handler code here
}

program is called edit2text. This is the ONLY part about the edit box I have in my main edit2textDlg.cpp file. The .rc you can see in the first picture.

I have found a somehow similar problem that was solved using dlg.DoModal(); and creating a variable for the edit box with a value-category, but could not understand how and why I should use it.

ElfenSky
  • 1
  • 2
  • An edit control works out of the box. If you cannot enter text you broke it in some way. Without seeing the relevant code it's impossible to tell how. Also, to keep stackoverflow a focused Q&A site it is recommended to stick to **one** issue per question. You can always ask a new question. – IInspectable Sep 22 '13 at 18:36
  • I see. I'll stick to 1 question at the time in the future. Should I post my code then? and of which .cpp should it be, then..? – ElfenSky Sep 22 '13 at 18:53
  • Source code is required, preferably an [SSCCE (Short, Self Contained, Correct Example)](http://www.sscce.org/). In other words, the least amount of code you can that exhibits the problem. Don't forget to add the relevant parts of the .rc file as well. – IInspectable Sep 22 '13 at 19:00
  • allright, I'll try creating that. Though when adding an edit box from the recourse editor.. Do I have to add ANY code at all to get it to work? EDIT: added. – ElfenSky Sep 22 '13 at 19:12
  • The edit control should accept text without adding ANY code. – ScottMcP-MVP Sep 22 '13 at 19:46
  • When using the resource editor to add an edit control there is no additional code required. There is also no code generated by the resource editor. All information is stored in the .rc file. It is important to see this (the screenshot is not enough). Go to the *Solution Explorer*, find the .rc file, select *View Code*. Copy the `DIALOGEX` section for your dialog and add it to your question. – IInspectable Sep 22 '13 at 19:47
  • 1
    Create a new MFC project. In the last page of the App Wizard, change your View's base class from `CView` to `CEditView`. Click "Finish" and then build the project. Your application is now complete and operational. – Jerry Coffin Sep 23 '13 at 07:00
  • Guys, I've found the answer. When compiling, it was referring to some old 2008 MS VS .dll file that did not exist. I'll reinstall Visual Studio (hoping that it'll help) or if it doesn't will reinstall windows. – ElfenSky Sep 23 '13 at 20:14

0 Answers0