Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 698075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:14:06+00:00 2026-05-14T03:14:06+00:00

I’ve built a C# .NET app that uses the Adobe ActiveX control to display

  • 0

I’ve built a C# .NET app that uses the Adobe ActiveX control to display a PDF.

It relies on a couple DLLs that get shipped with the application.
These DLLs interact with the locally installed Adobe Acrobat or Adobe Acrobat Reader installed on the machine.

This app is being used by some customer already and works great for nearly all users ( I check to see that the local machine is running at least version 9 of either Acrobat or Reader already ).

I’ve found 3 cases where the app returns the error message “Error HRESULT E_FAIL has been returned from a call to a COM component” when trying to load (when the activex control is loading).

I’ve checked one of these user’s machines and he has Acrobat 9 installed and is using it frequently with no problems. It does appear that Acrobat 7 and 8 were installed at one time since there are entries for them in the registry along with Acrobat 9.

I can’t reproduce this problem locally, so I am not sure exactly which direction to go.

The error at the top of the stacktrace is: System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.

Some research into this error indicates it is a registry problem.

Does anyone have a clue as to how to fix or work around this problem, or determine how to get to the core root of the problem?

The full content of the error message is this:

System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
   at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
   at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
   at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
   at System.Windows.Forms.AxHost.CreateInstance()
   at System.Windows.Forms.AxHost.GetOcxCreate()
   at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
   at System.Windows.Forms.AxHost.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.AxHost.EndInit()
   at AcrobatChecker.Viewer.InitializeComponent()
   at AcrobatChecker.Viewer..ctor()
   at AcrobatChecker.Form1.btnViewer_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:14:07+00:00Added an answer on May 14, 2026 at 3:14 am

    Ok, reporting back to answer my own question.

    The problem was directly related to the setting for ‘Display PDF in browser’ in Preferences > Internet.
    With this option checked, the problem goes away. When it is unchecked, it comes back.

    Here is how we propose to handle it programmatically:

        private string defaultPdfProg()
        { //Returns the default program for opening a .pdf file; On Fail returns empty string. 
          // (see notes below) 
            string retval = "";
    
            RegistryKey pdfDefault = Registry.ClassesRoot.OpenSubKey(".pdf").OpenSubKey("OpenWithList");
            string[] progs = pdfDefault.GetSubKeyNames();
            if (progs.Length > 0)
            {
                retval = progs[1];
                string[] pieces = retval.Split('.'); // Remove .exe
    
                if (pieces.Length > 0)
                {
                    retval = pieces[0];
                }
            }
    
            return retval;
        }
    
        private void browserIntegration(string defaultPdfProgram)
        { //Test if browser integration is enabled for Adobe Acrobat (see notes below)
            RegistryKey reader = null;
            string[] vers = null;
    
            if (defaultPdfProgram.ToLower() == "acrobat")
            { //Default program is Adobe Acrobat
                reader = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Adobe").OpenSubKey("Adobe Acrobat");
                vers = reader.GetSubKeyNames();
            }
            else if (defaultPdfProgram.ToLower() == "acrord32")
            { //Default program is Adobe Acrobat Reader
                reader = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Adobe").OpenSubKey("Acrobat Reader");
                vers = reader.GetSubKeyNames();
            }
            else
            {
                //TODO: Handle non - adobe .pdf default program
            }
    
            if (vers.Length > 0)
            {
                string versNum = vers[vers.Length - 1].ToString();
                reader = reader.OpenSubKey(versNum);
                reader = reader.OpenSubKey("AdobeViewer",true);
    
                Boolean keyExists = false;
                Double keyValue = -1;
                foreach(string adobeViewerValue in reader.GetValueNames())
                {
                    if (adobeViewerValue.Contains("BrowserIntegration"))
                    {
                        keyExists = true;
                        keyValue = Double.Parse(reader.GetValue("BrowserIntegration").ToString());
                    }
                }
    
                if (keyExists == false || keyValue < 1)
                {
                    string message = "This application requires a setting in Adobe to be changed. Would you like to attempt to change this setting automatically?";
                    DialogResult createKey = MessageBox.Show(message, "Adobe Settings", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
                    if (createKey.ToString() == "OK")
                    {
                        reader.SetValue("BrowserIntegration", 1, RegistryValueKind.DWord);
                        //test to make sure registry value was set
                    }
                    if (createKey.ToString() == "Cancel")
                    {
                        //TODO: Provide instructions to manually change setting
                    }
                }
            }
        }
    

    A few items to note:

    • It appears according to these two articles, the key can be in two different locations in the registry (Originals vs AdobeViewer) :
      http://support.adobe.com/devsup/devsup.nsf/docs/51722.htm
      http://support.adobe.com/devsup/devsup.nsf/docs/53556.htm

    Does anyone know if these locations are interchangeable in all versions or if based on specific versions of Acrobat the registry key is in different locations? Does Reader follow the same logic as Acrobat?

    • Does Adobe use any other method to determine the ‘default Adobe application for opening PDF files’ other than the windows file association? I ask because if you have a non-adobe product, such as FoxIt installed as the default file association application, but are using the ActiveX control for Adobe on a machine that has both Reader and Acrobat installed, what logic is used to decide which application the COM object will talk to?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.