Note that there are some explanatory texts on larger screens.

plurals
  1. PO800a0035 Error with Net-COM Interop
    text
    copied!<p>I have a C# application that needs to utilize a COM class that is written in VB6. The application has to use dynamic binding because it has to be able to use different versions of the code based on what version (i.e., what DLL) the user selected. The way the program supports this is to first detect all of the versions in the registry and then let the user pick.</p> <p>The code works on my machine and that of my peer reviewers, but the code that references the COM class is crashing for the person doing quality assurance (QA).</p> <p>I put a message box in the code to display the error, and this is what the QAer gets: <img src="https://i.stack.imgur.com/jhPBG.png" alt="enter image description here"></p> <p>I find the "FILENOTFOUND" part particularly confusing because I know that the DLL is present on her machine. In fact, she personally registered the DLL on her machine by using a right-click-to-register utility on the DLL; and this is the same utility that I used.</p> <p>I then did some further investigation to find exactly what line was crashing. Here is the code that instantiates the COM class with the problematic line called out : </p> <pre><code>//Constructor for HtmlRtfConvProxy public HtmlRtfConvProxy(String convWrapperProj) { convUtilType = Type.GetTypeFromProgID(convWrapperProj + "." + WRAPPER_CLASS_NAME); if(convUtilType == null) { throw new ArgumentException("Unable to find COM class"); } //The following line is crashing for the person doing QA vbTargetObject = Activator.CreateInstance(convUtilType); if(vbTargetObject == null) { throw new ExternalException("Unable to instantiate COM class"); } } </code></pre> <p>What I found even more confusing was which line was crashing. It was not the line where I tried to get a <code>Type</code> for the object but where I tried to <em>instantiate</em> the object. I would think that if the DLL couldn't be found, then the line where I am obtaining the <code>Type</code> would crash.</p> <p>I suspect that this has something to do with permissions, but my investigations along those lines have been fruitless. It looks like the QAer has the necessary permissions.</p> <p><strong>Note:</strong> I'm no guru when it comes to Windows file permissions.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload