Richtextbox SaveFile Release

Richtextbox SaveFile Release

Post by Morriga » Fri, 08 Dec 2006 22:56:53


Hello,

I am using the following code to add text to a RichTextBox:
rtfLog.AppendText("File not Found: " & MyPath & MySubPath & "\" &
ArtikelTempStr & ".pdf" & Chr(10)):


Next step is to save the Richtextbox.text as file with the following
code:
rtfLog.SaveFile(ErrorDir & "\" & LogFileName & ".log",
RichTextBoxStreamType.PlainText)

The file is created and is exactly as I want it, but...
When I hit the execute button on the form again, the file is locked
(being used by another process).
If I restart the program the file is released and it can be
overwritten< but thet is NOT my intention, the program will work 24/7
an may not have to be restarted every time it has don something.

Can anyone tell me what i can do to release the file and re-use or
delete the file?

I hope anyone of you out there has a solution or workaround for me.

Thanks in advance.
 
 
 

1. .xls savefile size

2. AttributeError: 'Attributes' object has no attribute 'saveFile'

Not sure how to explain, but I'll try my best. I'm making a GUI with
wxGlade. The GUI has windows that open when the "Next Page" button is
pushed; the button also pickles the information that is input into the
frame at the same time. The saveFile name is autocreated based on the
data entered by the user in the first frame.

Each frame that is created is a new class, e.g. the first frame that
opens is "CharInfo", which opens the frame "Attributes". The pickling
works for the first frame but doesn't work for the ones after.
Apparently the saveFile attribute I created in the "CharInfo" class
isn't carried through to "Attribures", even though it's supposed to be
a subclass.

I've tried several different ways to get it working, such as expressly
calling CharInfo.saveFile, calling CharInfo.pushedButton.saveFile
(saveFile is part of the pushedButton method), calling
Attributes.saveFile, and calling self.saveFile. Every time, I get the
AttributeError message stating saveFile is not an attribute of either
the classes or any function.

The reason I want to keep the same saveFile attribute through every
class is because the initial button in CharInfo creates the file save
name and path; I'd like to have it carried through the rest of the
classes so each new frame will save it's information to the same file.

Is there a way to keep the saveFile "live" throughout the entire
program or would it be better to create a "choose a filename" window at
the end of the program? If the latter, is there anything special I
need to know so the information in each class is pickled correctly?

3. ofstream SaveFile

4. Where does the .NET framework store the current folder for OpenFile and SaveFile Dialog?

5. SaveFile Dialog

6. SaveFile failure for TIFF format

7. SaveFile ListView columns

8. Gdiplus::Image::SaveFile - performance improvements

9. Wanted Please: Level 4 and 5 savefile for Mystery of the Mummy

10. wxImage.SaveFile into stream with TIFF format gives corrupted data

11. Tbitmap.SaveFile gets Out of system Resources!!

12. Clientdataset and incomplete saveFile

13. Re[2]: wxImage.SaveFile into stream with TIFF format gives corrupted data

14. [RELEASE] Python 2.7 release candidate 1 released

15. [ANN] Firebird .NET Data Provider 1.5 Release Candidate 2 released