?
Solved

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

Posted on 2007-12-03
4
Medium Priority
?
608 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

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

765 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