Skip navigation
mrktvalu
Currently Being Moderated

AxAcroPDF - Error HRESULT E_FAIL has been returned from a call to a COM component

Apr 12, 2012 10:44 AM

Tags: #reader #.net #axacropdf #dll

I am trying to use the AcroPDF.dll COM component to view pdf files from a .net application I am developing in Visual Basic under VS2010.

 

I have two very similar development computers, a development desktop and laptop, both running Visual Studio 2010 under Windows 7 SP1 with Adobe Reader 9.5 installed.  On both systems, the COM

component AcroPDF.dll, Adobe Acrobat 7.0 Browser Control Type Library 1.0, is added to my project as a COM resource.  The Laptop works fine with the AcroPDF.dll control in the VS2010 project, but the desktop is having all kinds of trouble.  Specifically, all of the Windows Form classes which reference or inherit references from other classes referencing some COM component cannot be loaded in the designer.  The types of errors I get include the following:

 

Failed to create component 'AxHost'.  The error message follows:  'System.Runtime.InteropServices.COMException (0x80004005): A wrapper assembly is not registered for this type library.  This error seems to point to the following statement which was created by the IDE in the deisgner:  CType(Me.AxAcroPDF1, System.ComponentModel.ISupportInitialize).BeginInit()

 

At other times, the designer will not open and the error message is: "Error HRESULT E_FAIL has been returned from a call to a COM component."  I don't get much debugging information from this, but it seems to point to AcroPDF.dll.

 

Can anyone give me some direction in solving this?   Thanks.

 
Replies
  • Currently Being Moderated
    Apr 12, 2012 12:59 PM   in reply to mrktvalu

    I don’t have anything specific about your problem, but I will point out that we don’t support VS2010 with Acrobat/Reader 9 – only VS2008.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 13, 2012 12:05 AM   in reply to mrktvalu

    make sure it is not a problem with 64 bit compilation.

    You need to compile explicitly as 32 bit on a 64-bit OS

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2012 4:32 PM   in reply to mrktvalu

    I have a similar problem, but the strange thing with my executable compiled with x86 with VS 2010 SP1:

    Can run on Windows XP, Windows Server x64, Windows 7 x64

    but can NOT run on Windows 7 x86.

     

    My Code Stop at the following Line of Code: 

    ((System.ComponentModel.ISupportInitialize)(this.axAcroPDF1)).EndInit()

     

    COMException occurred

    Error HRESULT E_FAIL has been returned from a call to a COM Component.

     

     

    None of the following test help me find the problem:

    I have a project created in VS2008 on XP.

    I then converted the Project into VS 2010 SP1 on Windows 7 x64 compile and it is running on the Windows 7 x86.

    I don't know what have change, I only change the code in other form, not the form with Acrobat Viewer Control, recompile and it is nolonger work

    on Windows 7 x86.

     

    I then do a search and found this post and try the x86 Compilation (Instead of Any CPU) and it work on Windows 7/Server x64 and Windows XP but not Windows 7 x86.

     

    I then went to the machine with Windows 7 x86 and install Visual Studio 2010, open up the project create a new form and add the Adobe PDF Reader

     

    I get and Error in Visual Studio when adding the control to the form as follow:

    Failed to create component 'AxHost'. The message follows:

    'System.Runtime.InteropServices.COMException (0x80004005): A wrapper assembly is not registered for this type library.

    at

    System.Windows.Forms.Design.DocumentDesigner.AxToolboxItem.CreateCompo nentsCore(IDesignerHost host)

    at

    System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)

    at

    System.Windows.Forms.Design.OleDragDropHandler.CreateTool(ToolboxItem tool, Control parent, Int32 x, Int32 y, Int32 width, Int32 height, Boolean hasLocation, Boolean hasSize, ToolboxSnapDragDropEventArgse)'

     

    I have try remove Acrobat Reader and ReInstall.

     

    Acrobat Reader v10.1.3

     

    Does any one spot any error  ?

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2012 5:08 PM   in reply to datauduong

    Here is the Solution worked for me:

    http://forums.adobe.com/message/1920206

     

    Open Acrobat Reader | Edit | Preferences | Internet

    Check the box Display PDF in browser

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points