Calling a .NET Component from a COM Component

Hi Experts, I have some logic written in a vb6 com component. But, now I need to create a .NET component with same logic, more like a dot net com to end up with managed code. And then, need to be able to call this dot net component from other existing vb6 coms I have in place and dot net pages simultaneously. What are the steps to achieve this. Any example that I can follow?
DevildibAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
- Create a class library in .NET.

- Mark the project as COM Visible
     - Project menu -> Project's Properties (last entry) -> Assembly Information .

- Code by being careful not to use stuff that does not existed in VB6 or has changed
     - You will discover them by testing, so test often.
     - The most important thing to consider is that what was Integer in VB6 is Short in .NET.
                                                                                                         Long in VB6 is Integer in .NET.
                                                                                                         Long in .NET is too big for VB6.

- The default type Variant does not exists in .NET. Object plays part of its role, but is not the
  same thing. So refrain from using Variant in your VB6 code.

- Once the dll is compiled, you need to register it by using RegSvr32 on a command line.

- It should then be available in the references in VB6. Cross your fingers from that side of things.

- You can reference it with a Browse from the References window in Visual Studio .NET.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.