Putting text into an Edit box from a file 
Author Message
 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  
 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  
 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  
 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  
 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  
 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  
 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  
 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  
 
 [ 8 post ] 

 Relevant Pages 

1. Wrapping text in text box or edit box

2. Show text file in edit box ?

3. list box text to edit box

4. put variable into a edit box

5. Newbie: putting variable data into edit box on the fly

6. Still trying to put button in edit box

7. How do you put a rich edit control in a dialog box

8. Put Rich Edit Box on FormView..

9. How do I put in edit boxes at run time

10. How to put bold text on dialog box

11. How put a text in a dialog box?

12. How to put tabbed text in CCombo box

 

 
Powered by phpBB® Forum Software