[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Reopen a textfile passed as an argument via a timer.

Posted on 1998-09-25
3
Medium Priority
?
195 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
[X]
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
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
danny_pav earned 150 total points
ID: 1322611
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
ID: 1322612
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
ID: 1322613
Get the name of the file to open--use CDocument::GetPathName
and use it as the argument to OnOpenDocument()
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

656 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