Author |
Message |
Fran #1 / 8
|
 Putting text into an Edit box from a file
Hi, Is it possible to read an ASCII file and put the contents into a multi-line Edit Box? If so, can the contents be written back out to a file? I want to create a simple pop-up applet to edit small utility files. I would just call Notepad, but I also need a couple of buttons on there to perform additional tasks. Here is a screenshot of what I'm talking about (~10k): http://www.*-*-*.com/ Thanks to anyone who can help me, - Frances
|
Sat, 24 Jan 2004 17:51:43 GMT |
|
 |
Paul S. Gann #2 / 8
|
 Putting text into an Edit box from a file
Quote:
>Hi, >Is it possible to read an ASCII file and put the contents into a multi-line >Edit Box? If so, can the contents be written back out to a file?
IIRC, you read the file & then use SetWindowText to set the text in the edit box. If you're using DDX, then just set the member variable for the edit box to the string. HTH Paul. ------------------------------------------- Expressed opinions are usually my own. Especially if they're any good (of course). -------------------------------------------
|
Sat, 24 Jan 2004 21:47:50 GMT |
|
 |
Jim Ros #3 / 8
|
 Putting text into an Edit box from a file
Hi Fran, Use AppWhiz to generate an SDI app. In the last step set the view type to CEditView. Now you have an app that already knows how to read an ASCII file into an edit control and then save it back again. For some ideas on how to go about customizing it, look over the Superpad sample app that comes with VC. Jim Quote:
> Is it possible to read an ASCII file and put the contents into a multi-line > Edit Box? If so, can the contents be written back out to a file? > I want to create a simple pop-up applet to edit small utility files. I > would just call Notepad, but I also need a couple of buttons on there to > perform additional tasks. Here is a screenshot of what I'm talking about
Jim [VC/MFC MVP] To send mail, change spam-me-not to msn
|
Sat, 24 Jan 2004 21:59:54 GMT |
|
 |
Fran #4 / 8
|
 Putting text into an Edit box from a file
Thanks Paul, I'll give it a try. - Fran
Quote:
> >Hi, > >Is it possible to read an ASCII file and put the contents into a multi-line > >Edit Box? If so, can the contents be written back out to a file? > IIRC, you read the file & then use SetWindowText to set the text in > the edit box. If you're using DDX, then just set the member variable > for the edit box to the string. > HTH > Paul. > ------------------------------------------- > Expressed opinions are usually my own. > Especially if they're any good (of course). > -------------------------------------------
|
Sat, 24 Jan 2004 22:44:04 GMT |
|
 |
Fran #5 / 8
|
 Putting text into an Edit box from a file
Thanks Jim, I will try this and see what happens. - Fran
Quote: > Hi Fran, > Use AppWhiz to generate an SDI app. In the last step set the view type to > CEditView. Now you have an app that already knows how to read an ASCII file > into an edit control and then save it back again. For some ideas on how to go > about customizing it, look over the Superpad sample app that comes with VC. > Jim
> > Is it possible to read an ASCII file and put the contents into a multi-line > > Edit Box? If so, can the contents be written back out to a file? > > I want to create a simple pop-up applet to edit small utility files. I > > would just call Notepad, but I also need a couple of buttons on there to > > perform additional tasks. Here is a screenshot of what I'm talking about > Jim [VC/MFC MVP] > To send mail, change spam-me-not to msn
|
Sat, 24 Jan 2004 22:44:57 GMT |
|
 |
Fran #6 / 8
|
 Putting text into an Edit box from a file
Hi Jim, Thanks again, this is pretty much what I was looking for. It is not monumentally important, but is there a way to change the default size of the dialog? Thanks, - Fran
Quote: > Hi Fran, > Use AppWhiz to generate an SDI app. In the last step set the view type to > CEditView. Now you have an app that already knows how to read an ASCII file > into an edit control and then save it back again. For some ideas on how to go > about customizing it, look over the Superpad sample app that comes with VC. > Jim
> > Is it possible to read an ASCII file and put the contents into a multi-line > > Edit Box? If so, can the contents be written back out to a file? > > I want to create a simple pop-up applet to edit small utility files. I > > would just call Notepad, but I also need a couple of buttons on there to > > perform additional tasks. Here is a screenshot of what I'm talking about > Jim [VC/MFC MVP] > To send mail, change spam-me-not to msn
|
Sun, 25 Jan 2004 02:59:54 GMT |
|
 |
Jim Ros #7 / 8
|
 Putting text into an Edit box from a file
Sure. Override PreCreateWindow in the CMainFrame and set the sizes in the CREATESTRUCT that gets passed in. Quote:
> Thanks again, this is pretty much what I was looking for. It is not > monumentally important, but is there a way to change the default size of the > dialog?
Jim [VC/MFC MVP] To send mail, change spam-me-not to msn
|
Sun, 25 Jan 2004 03:48:48 GMT |
|
 |
Fran #8 / 8
|
 Putting text into an Edit box from a file
Thanks Jim, that did the trick. - Fran
Quote: > Sure. Override PreCreateWindow in the CMainFrame and set the sizes in the > CREATESTRUCT that gets passed in.
> > Thanks again, this is pretty much what I was looking for. It is not > > monumentally important, but is there a way to change the default size of the > > dialog? > Jim [VC/MFC MVP] > To send mail, change spam-me-not to msn
|
Sun, 25 Jan 2004 07:16:57 GMT |
|
|