5

I'm trying to add a dll created from vb.net and i want to import it in existing vb 6 project but it gives me error "can't add reference to the specified file." . Anyone knows how can i fix this issue?

0

1 Answer 1

6

There are the steps to follow:

1) Create a class library in VS choose whatever language you want either Vb.NET or C#

2) Goto to Project Properties->ConfigurationProperties->build, check the Register for COM Interop checkbox. This creates the COM wrapper for your .NET assembly and hence need not use regasm.

3) Write whatever code you want, expose the classes publicly, expose the properties, functions you want publicly.

Now in your VB6 project, add the claslibrary.tlb created by the above program. Now use the classes and functions as you want.

Sign up to request clarification or add additional context in comments.

1 Comment

I did the above, but my namespace and classes were not recognised. Any other tips?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.