Solved

Interchangeable Code Library for VB6.0 and VB .Net

Posted on 2006-11-20
5
253 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

827 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