Solved

Reopen a textfile passed as an argument via a timer.

Posted on 1998-09-25
3
187 Views
Last Modified: 2013-11-19
I used the appwizard to create an SDI where I changed the base class of CView to CEditView.  So, a text file passed as a command-line argument will display and be editable(by default).  I have a text file that is accessed and changed from other sources on my network.  I have the timer in MainFrm set to go off every 3 secs.  I need to know how and where to close the file, so that the timer can reload it.
0
Comment
Question by:nunnbetter
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
danny_pav earned 50 total points
Comment Utility
1.  Consider reloading every three seconds.  Aren't you going to lose any changes you make in the EditView?
2.  Consider having a refresh menu item/toolbar button that also performs the same action.
3.  How to do it:  Add a function to the Document.  Have it call its own OnOpenDocument() (again) and when it is complete use UpdateAllViews() to change the view.
0
 

Author Comment

by:nunnbetter
Comment Utility
Well, the document will be read-only in the client area.  Strictly for viewing the file.  About the other, I am kind of confused.  Could you give me an example.  I used the class wizard to add the OnOpenDocument in the CMyDoc.  But, not sure what else to do.  Thanks.
0
 
LVL 3

Expert Comment

by:danny_pav
Comment Utility
Get the name of the file to open--use CDocument::GetPathName
and use it as the argument to OnOpenDocument()
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 113
Define unique primary key 9 81
method notes when mouse over in eclipse 5 66
move a line in eclipse 3 60
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now