Re: VB dll files

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Rob Windsor [MVP] (rwindsor_at_NO.MORE.SPAM.bigfoot.com)
Date: 02/12/04


Date: Thu, 12 Feb 2004 15:34:28 -0500

Hi Daryl,

Alex is right, you can do it that way but you can also do it using a more VB
6 style. The CreateObject function is still available in VB.NET so you could
use:

Dim obj As Object
obj = CreateObject("MyComp.MyClass", "MyServer")
' use object
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
obj = Nothing

Note this code shows how to use the object late bound and requires Option
Strict Off. You can do this early bound by setting a reference to your
component and using a variable to the correct type, this would of course be
preferred.

Rob

"Daryl Davis" <therulnotspam@hotmail.com> wrote in message
news:e9rePPa8DHA.3360@tk2msftngp13.phx.gbl...
> This is what I understand. What I don't understand is how I make the
> program go to the MTS server (another machine) for all the calls..
> I got some advice from AlexFeinman_MVP on the chat about smartdevices
today,
> but by the time I was able to try it out, I was unable to call any of my
> functions. I think it is that I am just unable to understand this area
> because it has been thrown on me and I am just learning web services. Can
> you help shed some light.
> Thank you,
> Daryl
> <snip from chat>
> AlexFeinman_MVP : Q: How do I write a web service that uses a remote
MTS
> component written in VB6 (using late binding)
> AlexFeinman_MVP : A: Use Dim t as Type =
> Type.GetFromProgID(componentProgID) to obtain a runtime type and then
> Activator.CreateInstance to create an instance of the component. Once you
> have an instance, use Type.InvokeMember to call methods.properties by name
> AlexFeinman_MVP : .
>
> "Rob Windsor [MVP]" <rwindsor@NO.MORE.SPAM.bigfoot.com> wrote in message
> news:e5H%23uHa8DHA.1052@TK2MSFTNGP12.phx.gbl...
> > Hi Daryl,
> >
> > .NET handles that for you! If you're using Visual Studio just go to the
> "Add
> > Reference" dialog and pick your VB 6 DLL from the list in the COM tab.
> > Visual Studio will create a .NET DLL wrapper for you automatically.
> >
> > You you're not using VS then you need to use the tlbimp.exe command line
> > utility which is part of the .NET Framework SDK. See the link below for
> more
> > info on this utility
> >
> >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfTypeLibraryImporterTlbimpexe.asp
> >
> > --
> > Rob Windsor [MVP-VB]
> > G6 Consulting
> > Toronto, Canada
> >
> >
> > "Daryl Davis" <therulnotspam@hotmail.com> wrote in message
> > news:O$rF6EZ8DHA.2656@TK2MSFTNGP11.phx.gbl...
> > > What I want to do....
> > > is write a .net dll to call vb6 dll's so that i have it wrapped so to
> > speak.
> > > Daryl
> > >
> > > "Rob Windsor [MVP]" <rwindsor@NO.MORE.SPAM.bigfoot.com> wrote in
message
> > > news:emZlOZO8DHA.2056@TK2MSFTNGP10.phx.gbl...
> > > > You can use VB.NET (or C#) to create the equivalent to a VB 6
ActiveX
> > DLL
> > > > using COM Interop. These DLLs could be used by .NET apps or VB (more
> > > > specificaly COM) apps. NOTE: If you want to create a DLL in VB.NET
> that
> > > will
> > > > be used by a VB 6 front-end you will need to deploy the .NET
Framework
> > to
> > > > the machines that will use the DLL.
> > > >
> > > > --
> > > > Rob Windsor [MVP-VB]
> > > > G6 Consulting
> > > > Toronto, Canada
> > > >
> > > >
> > > > "Daryl Davis" <therulnotspam@hotmail.com> wrote in message
> > > > news:Oe4fZxN8DHA.2832@tk2msftngp13.phx.gbl...
> > > > > Can I still write dll files in Visual basic.net?
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>