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

Reopen a textfile passed as an argument via a timer.

Posted on 1998-09-25
3
190 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
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 189
How to know only "File created" with EventLog 3 35
countEvens challenge 2 111
how to split multiple lines delimiter : 8 109
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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