处理 RTF 的过时版本

发布于 2024-07-15 10:32:17 字数 1709 浏览 3 评论 0原文

摘要问题:

  1. 您知道有一款可以以 RTF 版本 1.6 格式保存文件的轻量级应用程序吗?
  2. 你知道RTF Abiword的“旧应用程序的富文本格式”对应哪个版本吗?
  3. 您知道检查 RTF 文件并确定其编码的 RTF 版本的方法吗?
  4. 您知道哪个 DLL 描述了 Windows NT 4.0 机器上的 RTF 格式以及它是否可以升级吗?

我有一个旧版 MS Visual C++ 6.0 MFC 应用程序,它在嵌入式 Windows NT 4.0 计算机上运行。 该应用程序使用 MFC 的 CRichEditView 类从名为 help.rtf 的 RTF 文件中提取文本。 帮助文件保存为 RTF 版本 1.6。 它一直使用 MS Word 2000 或 Windows NT 4.0 附带的写字板版本进行编辑。

问题是我们的开发人员工作站往往配备 Windows XP(及其版本的写字板)和 Office 2003 或更高版本,两者都使用比 1.6 更新的 RTF 版本,并且找到一台可以运行 RTF 的计算机变得越来越麻烦。文件可以编辑并以过时的格式重新保存。 如果使用较新版本的 Word 或写字板保存文件,则会将其另存为较新版本的 RTF。 然后,当应用程序在 NT 计算机上运行时,帮助文本无法正确显示。 (尽管当相同的应用程序在 XP 计算机上运行时,帮助文本确实会正确显示。)

因此,我希望执行以下两件事之一:

  1. 找到一个可以保存文件的应用程序(最好是比 Word 2000 更轻量级的应用程序) RTF 版本 1.6 格式,我们可以使用它来将来编辑帮助文件。
  2. 找出一种方法让 NT 机器正确读取更高版本的 RTF。

在第一个方面,我尝试了 AbiWord,它有一个 "旧应用程序的富文本格式" 选项,但我不知道这是什么版本的 RTF选项输出。 你知道这是什么版本吗? 不幸的是,从文件中的元数据来看,这一点并不明显,根据所有版本的 RTF 规范。 有没有办法分析 RTF 文件并确定其编码的 RTF 版本?

本 RTF 规范中描述的 RTF 标准虽然标题为版本 1.6,但在语法上仍然与 RTF 规范版本 1 相对应。因此,\rtf 控制字的数字参数 N 仍应发出为 1。

在第二个方面,我我想知道是否有一些 DLL 可以更新,以便 Windows NT 能够识别该格式的较新版本。 你知道哪个DLL描述了RTF格式以及它是否可以升级吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

欲拥i 2024-07-22 10:32:17

我相信丰富的编辑格式是由丰富的编辑控件本身决定的。 我不会尝试升级 DLL,因为有很多东西可能会损坏。

有关使用更高版本的 Rich Edit 控件的提示,请参阅此 MSDN 注释。 2.0 版应该在 NT 4.0 中可用。

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

您可以尝试从 NT 系统复制写字板的版本,看看这是否可以作为替代方案。

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.

柠檬色的秋千 2024-07-22 10:32:17

首先想到的是写字板。 每台机器上都有它,并且 RTF 格式非常轻量。 我发现它在许多简单的 RTF 任务上比 Word 好得多。

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.

聽兲甴掵 2024-07-22 10:32:17

遵循从 Mark Ransom 的答案开始的一系列提示,我最终将 riched20.dll 和 riched32.dll 从 XP 计算机上的 C:\Windows\System32\ 复制到 NT 计算机上的 C:\WinNT\System32\ 。 执行此操作后,在 XP 计算机上使用写字板或 Word 编辑的 RTF 文件在写字板和 NT 计算机上的应用程序上都能正确呈现。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文