Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Interchangeable Code Library for VB6.0 and VB .Net

Posted on 2006-11-20
5
Medium Priority
?
271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

705 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