Visual c# Express Edition - 无法让 Acrobat pdf reader 工作

发布于 2024-08-18 08:11:12 字数 842 浏览 6 评论 0原文

我正在尝试在 Visual C# 2008 Express Edition 项目中使用 Acrobat 应用程序间通信 (IAC) 在 C# 应用程序内打开 PDF 文档。
执行以下代码时,出现异常:

CAcroPDDoc pdDoc = new AcroPDDocClass();  

该异常报告特定 CLSID 的 COM 类工厂已失败,错误为 80040154。在 MSDN 上查找 winerror.h 中的错误代码,该错误与未注册的类有关。
我尝试使用 regsvr32 注册 Interop.Acrobat.dll 但这无法工作(找不到入口点 DllRegisterServer)。
我尝试了 Acrobat 9 SDK 附带的示例 C# 项目(BasicIacCS - 有一个名为 BasicIacCS.suo 的 Visual Studio 项目,该项目导入到 c# Express 中没有任何错误,但失败并出现相同的异常)。


我犯了一些根本性的错误吗? (我是 Windows/.NET 编程新手)
这在 Express 版本下可行还是应该升级到 Visual Studio?


进一步研究这个问题,当我对我的应用程序(.exe 文件)执行 ILDASM 时,所抱怨的 CLSID 可用 - 它是我试图访问的 AcroPDDoc 类的 CLSID。注册表中不存在此类及其关联的 CLSID。 我只安装了 Acrobat reader - 不是完整版。访问 COM 接口是否需要完整版本的 Acrobat? (我的系统上只有 Acrord32.dll,没有 Acrobat.dll)。 我已经在不同的 Vista 计算机上尝试了相同的程序,并卸载/重新安装了 Arobat reader,结果相同。

I'm trying to open a PDF document inside a C# application using Acrobat Inter Application Communication (IAC) in a Visual C# 2008 Express Edition project.
When executing the following code I get an exception:

CAcroPDDoc pdDoc = new AcroPDDocClass();  

The exception reports that the COM class factory for a particular CLSID has failed with error 80040154. Looking up the error code in winerror.h on MSDN the error is related to the class not being registered.
I tried using regsvr32 to register the Interop.Acrobat.dll but this fails to work (can't find entry-point DllRegisterServer).
I have tried the example C# project that comes with the Acrobat 9 SDK (BasicIacCS - there's a visual studio project called BasicIacCS.suo, this imports into c# Express without any errors but fails with the same exception).


Am I making some fundamental mistake? (I'm new to Windows/.NET programming)
Is this possible under the express edition or should I upgrade to Visual Studio?


Looking further into the problem the CLSID that is being complained about is available when I do an ILDASM of my application (.exe file) - it's the CLSID of the AcroPDDoc class I'm trying to access. This class and it's associated CLSID is absent from the registry.
I only have Acrobat reader installed - not the full version. Is the full version of Acrobat required to access COM interfaces? (I only have Acrord32.dll, not Acrobat.dll present on the system).
I've tried out the same program on a different Vista machine and have uninstalled/reinstalled Arobat reader with the same result.

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

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

发布评论

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

评论(1

記柔刀 2024-08-25 08:11:12

问题可能在于主 Acrobat dll 未注册,而不是互操作 dll。

尝试重新安装 Acrobat,或注册 acrobat DLL。

The problem is probably in the main Acrobat dll not being registered, not the interop dll.

Try reinstalling Acrobat, or registering the acrobat DLLs.

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