|
-
Apr 14th, 2005, 01:20 AM
#1
Thread Starter
New Member
DLL from VB.Net to VB6
I'm new to VB.Net and I just want to ask if it is possible to create a DLL program in VB.Net that can be referenced or used in my VB6 project. I tried creating a DLL project and build it but when I tried to upload/referenced the DLL file in my VB6 project, an error occured "Cannot reference the file". I need somebody's help for this.
Thanks
JBats
-
Apr 14th, 2005, 03:24 AM
#2
Re: DLL from VB.Net to VB6
If it is possible, then you'd still need to ship the Framework with your program or at least have it installed on the machine you plan to run the VB6 app on. It'd probably be easier to try to write the DLL in VB6.
May we ask why you want to do this?
I don't live here any more.
-
Apr 14th, 2005, 04:10 AM
#3
Re: DLL from VB.Net to VB6
Use the Regasm.exe tool to create registry entries for your DLL in the registry, so that it can be accessed like a COM Component.
-
Apr 14th, 2005, 08:21 AM
#4
Addicted Member
Re: DLL from VB.Net to VB6
To elaborate a little more on Mendhak's answer...
Yes, it is possible. You have to install the .NEt Framework on the target machine and add the assembly to the machine's Global Assembly Cache. Then, you can add a reference to it in your project just like any other DLL.
This is a useful technique for incrementally migrating an application from VB6 to .NET.
-
Apr 14th, 2005, 06:15 PM
#5
Thread Starter
New Member
Re: DLL from VB.Net to VB6
I have an installed VB6 and .Net in my machine and tried building the project in .Net and reference it to VB6. The reason I was doing this research is that I have more than one DLL and OCX project created in VB6 and I want this to move/migrate in .Net slowly that is why I'm trying to move it one by one. I make it sure that when I've tried to work one project from VB6 migrating to .Net when building it, it doesn't change its bahavior when reference in VB6.
My goal in here is to migrate all my projects from VB6 to .Net one at a time. I've tried setting the property of my project in .Net the setting checked the "Register for COM Interop" and it builds a tlb file, when I tried referencing this in my VB6 project, It works ok but it gets hang-up when opening the program.
-
Apr 22nd, 2005, 08:00 AM
#6
Addicted Member
Re: DLL from VB.Net to VB6
If you check this thread, you'll find a link to a good article that explains how to do exactly what you want.
-
Aug 11th, 2005, 06:56 AM
#7
Fanatic Member
Re: DLL from VB.Net to VB6
this explains it perfectly too.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
-
Aug 11th, 2005, 07:11 AM
#8
Re: DLL from VB.Net to VB6
Funny that you should bump this thread up after so long, but another question came to me.
Can a control created in .NET be added to the components toolbar in Visual Basic? As an example, suppose I create a TextBox+Label control in VB.NET.
I use the Regasm.exe utility on the DLL, and then... what?
-
Aug 11th, 2005, 07:15 AM
#9
-
Aug 11th, 2005, 07:15 AM
#10
Re: DLL from VB.Net to VB6
We've gone the other way with our conversion.... rather than creating our components in .NET ( of which there are a lot of ) we are converting our frame work portion of the app (the main form and a few supporting forms) to .NET, then referencing the VB6 OXC and DLLs from that.... that allows us to migrate our components over time.
Tg
-
Aug 11th, 2005, 07:19 AM
#11
Re: DLL from VB.Net to VB6
 Originally Posted by wildcat_2000
this is why i came across this thread... doing search work before posting my question.
...you read my mind... hopefully you have a simulacre of solution too 
Are we working in the same office by any chance?
I'm trying to figure this out too at this very moment, and I was about to post a thread on this. If I find something I'll let you know. If you find anything, you better tell me too.
-
Aug 11th, 2005, 07:23 AM
#12
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|