467,915 Members | 1,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

dotNet dlls in VB6?

OK, this is a rather strange request

Is it possible to use dot-net dlls in VB6 projects?
Is anyone doing this or is this completely useless?

thx

Peter


Nov 21 '05 #1
  • viewed: 1223
Share:
4 Replies
Peter,

It is absolutely possible to use .NET dlls in VB6 projects. However,
you have to design your classes correctly so that they work with COM interop
correctly. Basically this means defining interfaces using Automation
compatable types, and then implementing them.

For more information, check out the tutorial in the .NET framework
documentation titled "COM Interop Part 2: C# Server Tutorial", located at
(watch for line wrap):

http://msdn.microsoft.com/library/de...ertutorial.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Peter Plumber" <Kl******@gmxdot.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
OK, this is a rather strange request

Is it possible to use dot-net dlls in VB6 projects?
Is anyone doing this or is this completely useless?

thx

Peter

Nov 21 '05 #2
One way would be to expose the managed code(.Net) functionality thru
COM for the unmanaged world(VB). There are possibly better ways than
this as this would require code change in .Net modules (comvisible
attribute).

---------
Ajay Kalra
aj*******@yahoo.com

Nov 21 '05 #3
"Peter Plumber" <Kl******@gmxdot.net> schrieb:
Is it possible to use dot-net dlls in VB6 projects?


<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp>
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconCOMInteroperability.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
This is definitely supported, and is pretty straightforward if you're using
the Visual Studio IDE.

Here's an overview
1. Create a VB class library project.
2. Add a new item using the "Com class" template.
3. Compile your project.

What this does is create the class, apply a comclass attribute, set the
correct GUID's for com interop, creates a VB6 class which wraps the VB.Net
class, registers the vb6 class.

Here's some docs you can look up:
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconmarshalingdatawithcominterop.asp

Did this give you the info you needed?

--------------------
Date: Mon, 21 Mar 2005 17:02:06 +0100
From: Peter Plumber <Kl******@gmxdot.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: dotNet dlls in VB6?
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <#X**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.vb.general.discussion,microsoft.p ublic.dotnet.languages.vb,
microsoft.public.dotnet.languages.csharpNNTP-Posting-Host: 83-64-137-178.work.xdsl-line.inode.at 83.64.137.178
Lines: 1
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP1
2.phx.gblXref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb:266599 microsoft.public.dotnet.languages.csharp:314725
microsoft.public.vb.general.discussion:542781X-Tomcat-NG: microsoft.public.dotnet.languages.vb

OK, this is a rather strange request

Is it possible to use dot-net dlls in VB6 projects?
Is anyone doing this or is this completely useless?

thx

Peter



Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Alex | last post: by
3 posts views Thread by Peter Plumber | last post: by
5 posts views Thread by Jozsef Bekes | last post: by
8 posts views Thread by Derek Hart | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.