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

  • Home
  • SEARCH
  • 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 6383977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:43:02+00:00 2026-05-25T02:43:02+00:00

I created a COM-interop .dll with this simple class: using System.Runtime.InteropServices; namespace ClassLibrary1 {

  • 0

I created a COM-interop .dll with this simple class:

using System.Runtime.InteropServices;

namespace ClassLibrary1
{
    [ComVisible(true)]
    [Guid("795ECFD8-20BB-4C34-A7BE-DF268AAD3955")]
    public interface IComWeightedScore
    {
        int Score { get; set; }
        int Weight { get; set; }
}

[ClassInterface(ClassInterfaceType.None)]
[Guid("9E62446D-207D-4653-B60B-E624EFA85ED5")]
public class ComWeightedScore : IComWeightedScore
{

    private int _score;

    public int Score
    {
        get { return _score; }
        set { _score = value; }
    }
    private int _weight;

    public int Weight
    {
        get { return _weight; }
        set { _weight = value; }
    }

    public ComWeightedScore()
    {
        _score = 0;
        _weight = 1;
    }
  }

}
I registered it using:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\regasm C:\ComClasses\Classlibrary1.dll /tlb: Classlibrary1.tlb

Finally I succesfully added a reference to the .dll after which VB6 gave me intellisense on the object.

Private Sub Form_Load()
    Dim score1 As ComWeightedScore

    Set score1 = New ComWeightedScore
    score1.Score = 500

End Sub

On the line Set score1=new ComWeightedScore the exception Automation Error is raised.

It can hardly be any simpler than this… Where is the error?!

  • 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-25T02:43:02+00:00Added an answer on May 25, 2026 at 2:43 am

    You forgot the /codebase option in the Regasm.exe command line.

    Without it, you’ll have to strong-name the assembly and put it in the GAC with gacutil.exe. Good idea on the client machine, just not on yours.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created my own simple logger class which uses COM interop to redirect
I have this website iloveforwards.com created using drupal. I would like to have a
I've created a c# com interop dll project that generates both .dll and .tlb
I've created an interop for a COM dll via tlbimp and added it to
I have application which can export slides to PowerPoint. I'm using Microsoft.Office.Interop.PowerPoint.dll . This
I have created a VB.NET Class Library that exposes some COM Interop sub routines.
I am trying to make a simple web application using ASP.NET and Interop COM.
I created a simple test page on my website www.xaisoft.com and it had no
I have created a .NET DLL which makes some methods COM visible. One method
I've created an interface called Initializable, but according to Dictionary.com this is not a

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.