Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Microsoft RichText Control Locks Up Converting RTF to Te
Message
De
29/10/2013 04:12:52
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
28/10/2013 21:57:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
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:
01586640
Vues:
75
This message has been marked as a message which has helped to the initial question of the thread.
J'aime (1)
>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!


My guess is that the RTF control is obsolete. It's probably still there from the last century. The specification of RTF has changed a few times since then, and it may be that something in the .rtf texts created with more recent tools may cause this old control to choke. Which is why it opens fine in Wordpad - which is newer by a number of years.

Suggestions... use Office automation, which is yet another can of worms, not really recommending that nowadays. Third party ActiveX may come handy, but they usually aren't just controls, they come loaded with features (i.e. they're full editors and may even spellcheck) so the cost is non-trivial, few hundred euros.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform