Solved

Interchangeable Code Library for VB6.0 and VB .Net

Posted on 2006-11-20
5
245 Views
Last Modified: 2012-05-05
I have an application that is currently written in VB 6. It is due for a groud up re-write but at the moment I am having to add functionality still in 6. I have other applications that work in conjunction with it and I want to create a shared code library. This would be OK if the other applications were developed using 6 but I am having to use .Net. Is it possible to create a shared .Net library that I can use with 6, or failing that, can I access the classes and objects compiled within the VB 6 application file (EXE) in my .Net apps.. The reason I need to make this so difficult is because of an auto update routine for the main application that is done on very restricitve networks, therefore I cannot create installers for DLL's or make registry changes.
0
Comment
Question by:whittinga2
  • 3
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17978787
You can have a .NET assembly that can be used with VB6, and you can have a VB6 library that you can access from .NET.  It is really up to you which direction you want to take.

Bob
0
 

Author Comment

by:whittinga2
ID: 17978822
How can I use a .Net assembly in VB 6?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17978862
Here is a good article describing the steps:

This article explains the step by step procedure of how to use a .NET Assembly with COM Client.
http://www.codeproject.com/useritems/COM_Interoperability.asp

The important piece is the regasm, that will register a .NET assembly in the registry for use in COM applications.

Bob
0
 

Author Comment

by:whittinga2
ID: 17978891
I presume this means that it has to be registered on each machine I want to use it on. This is the major problem and the reason why I don't think I am able to do this. The networks that the auto upgrade will be working on will not allow writing to the registry. I think that I am probably unable to do what I need to. Code duplication here I come...
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17978918
Yes, you presume correctly, and that is the mess of DLL hell--when a DLL/Assembly needs to be registered before it can be used.  

Bob
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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