Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Interchangeable Code Library for VB6.0 and VB .Net

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
whittinga2
Asked:
whittinga2
  • 3
  • 2
1 Solution
 
Bob LearnedCommented:
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
 
whittinga2Author Commented:
How can I use a .Net assembly in VB 6?
0
 
Bob LearnedCommented:
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
 
whittinga2Author Commented:
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
 
Bob LearnedCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now