Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Microsoft RichText Control Locks Up Converting RTF to Text
Message
De
28/10/2013 21:57:08
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Microsoft RichText Control Locks Up Converting RTF to Text
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01586633
Message ID:
01586633
Vues:
61
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 && Jam occurs executing this line and never recovers
	IF LEFT(loRTF.Text,6)="{\rtf1"
*---If the RTF is invalid it the text property will contain the original RTF
		lcText=.NULL.
	ELSE
*---Converted OK so we can return the text
		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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform