Solved

How do I diagnose and fix .Net Framework and/or COM interop issues?

Posted on 2007-12-03
4
607 Views
Last Modified: 2013-11-26
I have created a .Net dll that I call from VB6.  This works on most computers.  Some customers get the following error:
Run-time error '429'  ActiveX component can't create object.

To try to debug this, I create a simple VB6 app and a simple VB6 dll and simple .Net dll and I think the problem is with the .Net framework.  I uninstalled and reinstalled the framework (2.0) and on some users' machines that worked.  On several others, it doesn't work.  

The simple test I created just has a VB6 form with a two command buttons.  The code in the command buttons instantiate the VB6 dll or the .Net dll object and calls a function that simply displays a message box.  I figured it doesn't get any easier than that.  

On the machines that fail, when I click on the button that uses the .Net object, I get the dreaded 'Run-time error '429'  ActiveX component can't create object' error message.  
I created a simple VB dotNet (VS2005) class library that I called SimpleTest.  On the compile tab of the property page, I have checked the Register for COM interop option.  Here is the code:
 
<ComClass()> _
Public Class InteropTest
    Public Function ShowDialog() As Boolean
        MsgBox("Hello from .Net 2.0!")
    End Function
End Class
 
I then create a simple VB6 ActiveX dll called SimpleVB6.  Here is the code:
Public Function ShowDialog() As Boolean
    MsgBox ("Hello from VB6!")
End Function
 
I then created a simple VB6 Standard EXE application and set references to both SimpleTest (the dotNet dll) and SimpleVB6 (VB6 dll).  I put two command buttons on the form and added the following code:
Private Sub Command1_Click()
    Dim st As SimpleTest.InteropTest
    Set st = New SimpleTest.InteropTest
    st.ShowDialog
 
End Sub
 
Private Sub Command2_Click()
    Dim st As SimpleVB6Test
    Set st = New SimpleVB6Test
    st.ShowDialog
End Sub

Open in new window

0
Comment
Question by:DalexSupport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:wizengamot
ID: 20400001
I would check out the security for managed code between the two machines.  The applet you are looking for is in control panel --> administrative tools --> .NET Framework 2.0 Configuration.  The place I would concentrate my energies in comparing would be under My Computer (within the applet)  and the section entitled Runtime Security Policy.

I hope this helps.  This is the only thing I can think of that would make your DLL work or not work and a reinstall of the framework fixes it on some computers.  This means there is Nothing wrong with your DLL and everything that could be wrong is in the configuration of the framework
0
 

Accepted Solution

by:
DalexSupport earned 0 total points
ID: 20415847
.NET Framework 2.0 Configuration doesn't appear there.  

I have done some additional digging in one of my customer's computer and found that the 1.0 Framework seems to be the problem.  This computer is running the Tablet edition of Windows XP.  I found a tool at http://blogs.msdn.com/astebner/archive/2005/04/08/406671.aspx that is disigned to remove any .Net framework version. However, this tool would not remove the 1.0 framework because it said it was required by the Table Edition of the operating system (as well as the Media Center Edition).  

The only way I can get the the 2.0 framework to function is to uninstall all frameworks, reboot in safe mode and then delete the following files/folders:
C:\WINDOWS\Microsoft.NET\Framework
C:\WINDOWS\system32\mscoree.dll
C:\WINDOWS\system32\mscorier.dll
C:\WINDOWS\system32\mscories.dll

Then reboot normally and install the 2.0 framework and my app and all is well.

Am I doing anything here that can prevent other apps from running?
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20555478
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question