4

I'm upgrading a VB6 app to VB.Net. It used the "Adobe Acrobat 10.0 Type Library". However, when using with the .Net project I'm getting the error in the title. I created a small test project. The exception is thrown when I try to instantiate an AcroPDDoc, on the following line:

Dim acroApp As Acrobat.AcroPDDoc = New Acrobat.AcroPDDoc()

The adobe library resides at C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.dll. When added, it puts a dll called "Interop.Acrobat.dll" into the project's obj folder. I've tried running RegSvr32.exe on both dlls, as I saw advised somewhere, but recieved an error along the lines of

dll was loaded but the call to DllRegisterServer failed with error code 0x80004005

I haven't been able to find a great deal on that error code.

I've also tried chainging the platform target to x86 from 'any cpu'.

EDIT - I've experienced the same problem on both 32 and 64 bit editions of windows 7.

In win 7 64, I entered the following:

C:\Windows\SysWOW64> regsvr32 "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.dll"

received the following error:

RegSvr32 error - 64 bit win7

In win 7 32, entered the following:

C:\Windows\system32> regsvr32 "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.dll"

recieved the following error:

RegSvr32 error - 32 bit win7

EDIT 2 - As per Raymond Chen's suggestion, I took another pass at the Adobe site. I found a couple of threads here, here, and another question on stackoverflow. The former two links don't refer specifically to .NET, but from them, it seems as though the full version of Acrobat Reader must be installed for these interop classes to work/for the dll in question be registered. I'll check tomorrow, but I have a strong suspicion that the customer's environment may include full versions of Acrobat Reader. To all who answered, thanks for your time.

EDIT 3 - Got my hands on the full version of Acrobat, installed and, lo and behold, everything's dandy!

Community
  • 1
  • 1
dbr
  • 247
  • 2
  • 7
  • 24
  • 1
    Have you tried running the program with administrative privileges or turning off UAC? – CodingGorilla Feb 13 '13 at 17:25
  • 1
    AS CodingGorilla, use admin permissions on the command line. Also if you are running a 64bit PC navigate to `\windows\syswow64` – Ulises Feb 13 '13 at 17:27
  • @CodingGorilla - Aye, I'm an admin on the machine. I've run both the program and regsvr32 with as an admin, no joy. – dbr Feb 13 '13 at 17:30
  • @dbr But just to be clear, being an admin is not sufficient (unless UAC is disabled). You may have to actually "Run as administrator". – CodingGorilla Feb 13 '13 at 17:32
  • @Ulises I'm on 64 bit win7. But I no /windows/syswow64 folder exists. Should I be worried? :) – dbr Feb 13 '13 at 17:32
  • @CodingGorilla Thanks for the clarity. Yea, I've specifically chosen "Run as Administrator" when opening the command window – dbr Feb 13 '13 at 17:33
  • RE: syswow64, yes you should be worried, that **has to be there** or you have much larger problems. Also, are the same Adobe components that were installed on the original development environment installed on this one? – CodingGorilla Feb 13 '13 at 17:35
  • Error 0x80040154 is "class not registered" which means that the Acrobat object is not properly installed. 0x80004005 is [E_FAIL](http://msdn.microsoft.com/en-us/library/windows/desktop/aa378137(v=vs.85).aspx). This is an error being returned by acrord32.dll - you need to ask Adobe why their DLL failed registration. – Raymond Chen Feb 13 '13 at 17:46
  • A 32-bit program installed in c:\program files on a 64-bit machine? How did it get so messed up? – Hans Passant Feb 13 '13 at 17:52
  • @CodingGorilla - You're quite right, it is there. I've gotten mixed up; my dev VM runs a 64 bit version of win7. My actual machine, which I created the small test project on, does not. I forgot this completely, apologies. The problem persists on both however. I'll update my question to avoid any confusion. – dbr Feb 13 '13 at 19:53
  • @RaymondChen - Thanks very much for that. I'll have a poke around the adobe site again, though there seems to be little info knocking about on it. – dbr Feb 13 '13 at 19:55

1 Answers1

1

As noted above, the dll would not allow itself to be registered unless the full version of Acrobat was installed on the machine.

dbr
  • 247
  • 2
  • 7
  • 24