doc/view
-
I have an MDI program. One of the dialog boxes carries out some calculations and writes them to a file. I would like the program to open the file automatically. The file name will be known. The user defines it in the dialog box. Thanks I feel more like I do now than I did awhile ago.
-
I have an MDI program. One of the dialog boxes carries out some calculations and writes them to a file. I would like the program to open the file automatically. The file name will be known. The user defines it in the dialog box. Thanks I feel more like I do now than I did awhile ago.
This is a basic operation with iostreams - I have articles on CP, the MSDN has info also, as does google. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
This is a basic operation with iostreams - I have articles on CP, the MSDN has info also, as does google. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
The MDI program is a text editor. I would like the file to be visable as if the user had opened it with the file open dialog box. Is this still covered with IOstreams?
Absolutely - an ifstream will read your file in no worries, and then you can just set up your editor to contain the data read in. something like std::ifstream a(szFilename); std::string s; while (getline(a, s)) MyInternalBuffer += s.c_str(); You need to include string and fstream for this to work. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
Absolutely - an ifstream will read your file in no worries, and then you can just set up your editor to contain the data read in. something like std::ifstream a(szFilename); std::string s; while (getline(a, s)) MyInternalBuffer += s.c_str(); You need to include string and fstream for this to work. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
How do I set up the editor to contain the data? that is where i am having problems. I have no problem reading the data into the buffer. I thought maybe I could CMyDoc* pdoc; pdoc.OpenFile( CString path ); I have searched my books on Doc/View architecture. I am sure the answer is there but I don't see it. Thank You
-
How do I set up the editor to contain the data? that is where i am having problems. I have no problem reading the data into the buffer. I thought maybe I could CMyDoc* pdoc; pdoc.OpenFile( CString path ); I have searched my books on Doc/View architecture. I am sure the answer is there but I don't see it. Thank You
kjessee wrote: How do I set up the editor to contain the data? Oh - the problem is not loading, it's actually having the text in the editor ? There are many ways to go about this, the simplest is to use a CEditView ( from memory ) and call SetWindowText on it. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002