dmfolsom
asked on
RichTextBox is running my computer out of Memory
OS: Windows 2000 and Windows XP
VB5 Service Pack 3
I have an application that loads a Rich Text Box with a .Rtf file every ten seconds.
rtbWelcome.LoadFile fileWelcome_Docs.Path + "\" + fileWelcome_Docs.List(MyCo unter), rtfRTF
These files were created in Word then converted to Richtext format to be displayed in the RichText Box.
These files contains Text, Inserted Pictures and other Graphics.
After displaying the RTB for ten seconds, it is cleared using rtbWelcome.TextRTF = ""
The memory used by the RTB is partially cleared, however the majority is not. When the application loads the next file the memory used by the application is increased until the point the the computer runs out of resources and crashes.
How do I recover all memory each time I unload the file?
Would there be a better format to display these files to computers that don't have word installed?
VB5 Service Pack 3
I have an application that loads a Rich Text Box with a .Rtf file every ten seconds.
rtbWelcome.LoadFile fileWelcome_Docs.Path + "\" + fileWelcome_Docs.List(MyCo
These files were created in Word then converted to Richtext format to be displayed in the RichText Box.
These files contains Text, Inserted Pictures and other Graphics.
After displaying the RTB for ten seconds, it is cleared using rtbWelcome.TextRTF = ""
The memory used by the RTB is partially cleared, however the majority is not. When the application loads the next file the memory used by the application is increased until the point the the computer runs out of resources and crashes.
How do I recover all memory each time I unload the file?
Would there be a better format to display these files to computers that don't have word installed?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the response!
I use the second option befor each load:
rtbWelcome.TextRTF = ""
rtbWelcome.Text = ""
rtbWelcome.LoadFile fileWelcome_Docs.Path + "\" + fileWelcome_Docs.List(Saf) , rtfRTF
I use the second option befor each load:
rtbWelcome.TextRTF = ""
rtbWelcome.Text = ""
rtbWelcome.LoadFile fileWelcome_Docs.Path + "\" + fileWelcome_Docs.List(Saf)
ASKER
Thanks for the response!
I use the second option before each load:
rtbWelcome.TextRTF = ""
rtbWelcome.Text = ""
rtbWelcome.LoadFile fileWelcome_Docs.Path + "\" + fileWelcome_Docs.List(Saf) , rtfRTF
Still incrementing up the memory used. Any other suggestions?
I use the second option before each load:
rtbWelcome.TextRTF = ""
rtbWelcome.Text = ""
rtbWelcome.LoadFile fileWelcome_Docs.Path + "\" + fileWelcome_Docs.List(Saf)
Still incrementing up the memory used. Any other suggestions?
Did youtry the first example where you save off an empty rtf then copy that into the rtf
ASKER
I really appreciate you involvement!
I tried it this way first:
'rtbWelcome.TextRTF = ""
'rtbWelcome.Text = ""
rtbWelcome.TextRTF = strRTB
Then switched to this:
rtbWelcome.TextRTF = ""
rtbWelcome.Text = ""
rtbWelcome.TextRTF = strRTB
Still incrementing the memory.
I tried it this way first:
'rtbWelcome.TextRTF = ""
'rtbWelcome.Text = ""
rtbWelcome.TextRTF = strRTB
Then switched to this:
rtbWelcome.TextRTF = ""
rtbWelcome.Text = ""
rtbWelcome.TextRTF = strRTB
Still incrementing the memory.
rtbWelcome.TextRTF = ""
rtbWelcome.Text = ""