单词拼写检查在 Word 2007/Vista 上运行缓慢

发布于 2024-07-06 12:21:22 字数 401 浏览 7 评论 0原文

我编写了一个 DLL,它使用 MS Word 对 RichtextBox 的内容进行拼写检查。 该项目使用Microsoft Word 11.0 对象库。 我读到您可以在使用该版本的 Word 或更高版本的计算机上使用该参考,这似乎是正确的。

但是...当我在装有 Windows Vista 和 Word 2007 的计算机上的测试应用程序中运行 dll 时,它运行速度非常慢。 2007 版本的 Word 对象库是否有任何不同,导致自动化过程中速度非常慢? 或者是运行时的某种重新解释使其表现得像这样?

我是否应该制作不同版本的 dll,一种适用于装有 Word 2003 的计算机,另一种适用于装有 Word 2007 的计算机? 这确实会使制作拼写检查 dll 用于许多不同项目的整个意义变得毫无意义。

I have written a DLL that uses MS Word to spell check the content of a RichtextBox. The project uses Microsoft Word 11.0 Object Library. I have read that you can use that reference on machines using that version of Word or later, and that seem to be true.

However ... When I run the dll in a test app on a machine with Windows Vista and Word 2007 then it runs very slow. Does the Word Object Library for the 2007 version differ in any way that makes it really slow during automation? Or is it some kind of re-interpetation at runtime that makes it behave like this?

Should I make different version of the dll, One for machines with Word 2003 and one for machines with Word 2007? That would really make the whole point of making a spell checking dll for use in many different project kind of pointless.

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

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

发布评论

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

评论(1

阳光下慵懒的猫 2024-07-13 12:21:22

您应该像解决任何其他工程问题一样解决这个问题:
1.分析代码,看看是否是你的错
2a. 如果是您的错,请根据需要进行更正
2b. 如果是那个特定的 .dll,请将拼写检查对象定义为接口或抽象类,并在运行时使用最适合您运行环境的该接口的具体实例。

You should approach this like any other engineering problem:
1. Profile the code to see if it's your fault or not
2a. If it's your fault, correct as needed
2b. If it's that particular .dll, define your spell checking object as an interface or an abstract class and at runtime, use a concrete instance of that interface that is most appropriate for the environment in which you're running.

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