Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveX component can't create object? .NET COM

I am currently trying to reference a .NET COM library in my Visual Basic 6 application. I have registered it, using Regasm and I have set ComVisible to true within my class. However when I try to run my application i get the following error:

ActiveX component can't create object.

My library consists of a very simple function (since I just wanted to test if I could even run it), it just returns the string "Hello World".

I had to use a different machine (machine 1) to create my C# .Net class and then copy that class onto another machine (machine 2) and from there register the dll and reference it in my project. I then tested my project on a separate machine (machine 3) which is were I received the error.

I really need help with this, I have already tried to un-register and re-register it and still to no avail.

like image 844
dantheman Avatar asked Dec 06 '25 09:12

dantheman


1 Answers

Try this.

From an elevated command prompt:

  1. RegAsm /codebase /tlb AssemblyName.dll. Take note of the .tlb file generated.
  2. RegTlib File.tlb
  3. Open your VB6 project and reference the .tlb file.
like image 127
Craig Johnson Avatar answered Dec 07 '25 22:12

Craig Johnson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!