80040154 Class 未注册(Debenu PDF 库)

80040154 Class Not Registered (Debenu PDF Library)

我已经成功使用 Debenu PDFLibrary 一段时间了。我决定将库更新到最新版本 (DebenuPDFLibrary64Lite1113.dll)。就在那时,一切都发生了变化。

我按照说明进行安装,包括注册 DLL。注册过程没有产生错误。注册表包含如下所示的 CLSID。

我的环境是 64 位 Windows 8.1 Pro 和 .NET 4.5.1 框架。已安装所有更新。开发环境为Visual Basic .NET,使用VS 2013 Community Edition

当我像过去一样尝试使用该库时,出现此错误:

Retrieving the COM class factory for component with CLSID {924F2468-6F4E-4E90-BCD3-A81D43ED8759} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

代码如下:

Try
    PDFDoc = New PDFLibrary(STR_PDFLibrary)
Catch ex As InteropServices.COMException
    _TerminalErrors.Add(String.Format("Error loading PDFLibrary{0}{1}{0}{2}", vbCrLf, ex.Message, ex.StackTrace))
     Exit Function  
End Try

我已经在 Whosebug 中查看了有关此错误的问题,但无法找到解决此问题的方法。

可能是您注册了 64 位版本的 ActiveX,但您的项目设置为 x86(32 位)。

您可以尝试以下测试:

  1. 取消注册 Lite ActiveX 的 32 位和 64 位版本

regsvr32 [此处路径]\DebenuPDFLibrary64Lite.dll /u regsvr32 [此处路径]\DebenuPDFLibraryLite.dll /u

  1. 仅注册 64 位版本的 Lite ActiveX

regsvr32 [此处路径]\DebenuPDFLibrary64Lite.dll

  1. 创建一个 Visual Studio VB.NET 项目并将平台设置为 x86(不是 AnyCPU 或 x64)

  2. 运行 应用程序,看看它是否显示相同的错误消息

如果此测试确实显示相同的错误消息,那么您有两个选择:

选项 1:注册 Lite ActiveX 的 32 位和 64 位版本

这将允许您在项目中进行任何平台设置(x86、AnyCPU 或 x64)

选项 2:将项目设置更改为 x64

无需注册 32 位版本的 Lite ActiveX,但该应用程序只能在 64 位系统上运行。