Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Open File Please Help

Posted on 2000-04-13
3
211 Views
Last Modified: 2010-04-02
I need to know how to read data from atext file and display it
in Single Document Interface by using MFC in Visual c++.
0
Comment
Question by:catdaddy123
3 Comments
 
LVL 1

Expert Comment

by:MT_MU
ID: 2713614
The method with the least coding...

Use app wizard to create a SDI application.

When the Wizard gets to the step where it shows the classes it is about to create for you - Select the "view" class and change it's base class to CEditView.

0
 
LVL 6

Expert Comment

by:graham_k
ID: 2714242
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 50 total points
ID: 2714554
Look at the Multipad sample in MFC.

It is a MDI example, but shows you how to read and write the text file etc.  In particular, look at the document class which has only one function overriden to do this:

void CPadDoc::Serialize(CArchive& ar)
{
  ((CEditView*)m_viewList.GetHead())->SerializeRaw(ar);
}

Then use AppWizard to create an SDI document/view app with the view based on CEDitView.

Make the appropriate changes/additions as per MultiPad for reading and writing the file (like the above), and you're done.

You might also then want to add a toolbar as in Multipad.

Then, when you've had enough of that .. look at SuperPad, which adds a heap of functionality to give you a really nice text editor.

here are the extra that SuperPad shows you how to do:
>About dialog box showing system resource usage.
>Splash window that is displayed when the application first starts.
>Persistent window placement by storing window position information in a private .ini file.
>Idle loop processing.
>Using a wait cursor.
>Subclassing a window.
>Adding page headers and footers during printing.
>Page breaking during printing.
>Starting print preview at the current selection in the document.
>Returning from print preview to the same position in the document as last previewed.
> Standard font dialog box (CFontDialog).

PS: This question really belongs in the MFC area.

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question