Hi There,
I have a VFP 9.0 app that batch converts RTF data to ASCII text using the MS RichText control V6.0. Sometimes however we encounter an RTF file that locks up VFP during conversion and can not be recovered from (the process has to be terminated). If not terminated the VFP app will use up all available memory on the machine - eventually causing other apps to fail - which is catastrophic.
We are not sure what about the RTF causes this to happen as these apparently corrupt RTF files can usually be loaded just fine into MS Word/Wordpad just fine. I am not worried if we can't convert one of these corrupt RTF files at all - I'd be fine just moving the RTF file to a folder and ignoring it. I just can't have the app locking and killing the server. I know the issue is with the RTF control and that is where the actual lock occurs. The app does contain much more logic than just the RTF conversion so we can't just throw it away (it needs to remain in VFP).
The code that does the conversion is as follows:
loRTF=CREATEOBJECT("RICHTEXT.RichtextCtrl.1")
loRTF.TextRTF=m.tcRTFContent
IF LEFT(loRTF.Text,6)="{\rtf1"
lcText=.NULL.
ELSE
lcText=loRTF.Text
ENDIF
RELEASE loRTF
The loRTF object is released after each conversion to ensure it is clean.
Does anyone have any experience with batch converting RTF's or just converting RTFs to text in general? Has anyone encountered something like this? Any suggestions at all are welcome! I'd love to be stop this happening once and for all!
Thanks
Dan