Link to home
Start Free TrialLog in
Avatar of fredmastro
fredmastroFlag for United States of America

asked on

EDIT Box to load up a .TXT File

Ok I have asked this before in the past, but I'm slow to this MFC Visual C++ stuff. I don't know any of the terms, all I do know is that I'm using MS Visual C++ 6.0, and how to point and click and type in stuff and semi, know how to program in VC a little.

Anyway, if you are going to give me cut and past code from codeguru.com then please explain it to me simply where it needs to go.

I have my Dialog box, in the call CMyDialog, in the box I have a Edit box, I have a veriable assisnged to it, called m_Message. I want the edit box to load up a txt file (yes it will be less then 64K) into the edit box when the program is loaded. It's just a one window dialog box program. Where do I put this code once I do get it? If you are familr with MS' Visual C++ Program, if you could tell me where exactly to go.  Thanks very much.
ASKER CERTIFIED SOLUTION
Avatar of Vinayak Kumbar
Vinayak Kumbar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sadhu
Sadhu

In OnInitDialog() function of your CMyDialog class. If you do not have function from menu->Class-wizard->select MyDialog class->add functon for WM_INITDIALOG. read text file into buffer then copy to m_Message and then call UpdateData(FALSE).

Hope this helps
Sadhu
Hi,

I forgot to tell. put this code before the OnInitDialog()'s
return TRUE;

UpdateData(FALSE);
So that it will update the edit box.

Hope this helps. If U want sample I will send it to U. give me Ur mailID.

VinExpert