views:

322

answers:

3

Summary questions:

  1. Do you know of a lightweight application that can save files in RTF Version 1.6 format?
  2. Do you know what version of RTF Abiword's "Rich Text Format for old apps" corresponds to?
  3. Do you know a way to inspect an RTF file and determine what version of RTF it's encoded under?
  4. Do you know which DLL describes the RTF format on a Windows NT 4.0 machine and whether it can be upgraded?


I have a legacy MS Visual C++ 6.0 MFC application that runs on an embedded Windows NT 4.0 machine. The application provides in-app help using MFC's CRichEditView class to pull text out of an RTF file called help.rtf. The help file is saved as RTF version 1.6. It has always been edited using MS Word 2000 or the version of WordPad that comes with Windows NT 4.0.

The problem is that our developer workstations tend to have Windows XP (and its version of WordPad) and Office 2003 or better, both of which use more recent versions of RTF than 1.6, and it is becoming increasingly cumbersome to find a machine on which the file can be edited and re-saved in that obsolete format. If a newer version of Word or WordPad is used to save the file, it gets saved as a newer version of RTF. Then, when the application is run on the NT machine, the help text doesn't display properly. (Although when the same application is run on an XP machine, the help text does display properly.)

So, I'm looking to do one of two things:

  1. Find an application (preferably lighter-weight than Word 2000) that will save files in RTF version 1.6 format, that we can use for future editing of the help file.
  2. Figure out a way to get the NT machine to read later versions of RTF properly.

On the first front, I've tried AbiWord, which has a "Rich Text Format for old apps" option, but I can't tell what version of RTF this option outputs. Do you know what version this is? Unfortunately, it's not readily apparent from the metadata in the file, which just says "rtf1", per this cute passage from all versions of the RTF spec. Is there a way to analyze an RTF file and determine what version of RTF it's encoded under?

The RTF standard described in this RTF Specification, although titled as version 1.6, continues to correspond syntactically to RTF Specification version 1. Therefore, the numeric parameter N for the \rtf control word should still be emitted as 1.

On the second front, I'm wondering if there's some DLL that I can just update so that Windows NT will recognize the newer version of the format. Do you know which DLL describes the RTF format and whether it can be upgraded?

A: 

First thing that comes to mind is WordPad. It's on every machine and is really lightweight in it's RTF. I've found it much better than Word at many simple RTF tasks.

WaldenL
The version of WordPad that comes with Windows XP saves RTF files in a newer version of RTF.
MOE37x3
+1  A: 

I believe the rich edit format is determined by the rich edit control itself. I wouldn't try to upgrade the DLL, because there's a lot that could break.

See this MSDN note for hints on using the later version of the rich edit control. Version 2.0 should be available in NT 4.0.

http://msdn.microsoft.com/en-us/library/tt1cfb9f(VS.80).aspx

You might try copying the version of WordPad from your NT system and see if that works as an alternative.

Mark Ransom
A: 

Following a chain of hints that started with Mark Ransom's answer, I ended up copying riched20.dll and riched32.dll from C:\Windows\System32\ on my XP machine to C:\WinNT\System32\ on the NT machine. After I did this, RTF files edited with WordPad or Word on the XP machine rendered correctly on both WordPad and my application on the NT machine.

MOE37x3
That was a gutsy move. I'm glad it worked for you.
Mark Ransom