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? :)
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.
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.
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.
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.
Re: DLL from VB.Net to VB6
this explains it perfectly too.
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?
Re: DLL from VB.Net to VB6
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 :)
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
Re: DLL from VB.Net to VB6
Quote:
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. :)
Re: DLL from VB.Net to VB6
mendak please continue on this post, i am just posting a message for you :)